PostgreSQL Source Code  git master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
pg_database.h
Go to the documentation of this file.
1 /*-------------------------------------------------------------------------
2  *
3  * pg_database.h
4  * definition of the system "database" relation (pg_database)
5  * along with the relation's initial contents.
6  *
7  *
8  * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
9  * Portions Copyright (c) 1994, Regents of the University of California
10  *
11  * src/include/catalog/pg_database.h
12  *
13  * NOTES
14  * the genbki.pl script reads this file and generates .bki
15  * information from the DATA() statements.
16  *
17  *-------------------------------------------------------------------------
18  */
19 #ifndef PG_DATABASE_H
20 #define PG_DATABASE_H
21 
22 #include "catalog/genbki.h"
23 
24 /* ----------------
25  * pg_database definition. cpp turns this into
26  * typedef struct FormData_pg_database
27  * ----------------
28  */
29 #define DatabaseRelationId 1262
30 #define DatabaseRelation_Rowtype_Id 1248
31 
33 {
34  NameData datname; /* database name */
35  Oid datdba; /* owner of database */
36  int32 encoding; /* character encoding */
37  NameData datcollate; /* LC_COLLATE setting */
38  NameData datctype; /* LC_CTYPE setting */
39  bool datistemplate; /* allowed as CREATE DATABASE template? */
40  bool datallowconn; /* new connections allowed? */
41  int32 datconnlimit; /* max connections allowed (-1=no limit) */
42  Oid datlastsysoid; /* highest OID to consider a system OID */
43  TransactionId datfrozenxid; /* all Xids < this are frozen in this DB */
44  TransactionId datminmxid; /* all multixacts in the DB are >= this */
45  Oid dattablespace; /* default table space for this DB */
46 
47 #ifdef CATALOG_VARLEN /* variable-length fields start here */
48  aclitem datacl[1]; /* access permissions */
49 #endif
51 
52 /* ----------------
53  * Form_pg_database corresponds to a pointer to a tuple with
54  * the format of pg_database relation.
55  * ----------------
56  */
58 
59 /* ----------------
60  * compiler constants for pg_database
61  * ----------------
62  */
63 #define Natts_pg_database 13
64 #define Anum_pg_database_datname 1
65 #define Anum_pg_database_datdba 2
66 #define Anum_pg_database_encoding 3
67 #define Anum_pg_database_datcollate 4
68 #define Anum_pg_database_datctype 5
69 #define Anum_pg_database_datistemplate 6
70 #define Anum_pg_database_datallowconn 7
71 #define Anum_pg_database_datconnlimit 8
72 #define Anum_pg_database_datlastsysoid 9
73 #define Anum_pg_database_datfrozenxid 10
74 #define Anum_pg_database_datminmxid 11
75 #define Anum_pg_database_dattablespace 12
76 #define Anum_pg_database_datacl 13
77 
78 DATA(insert OID = 1 ( template1 PGUID ENCODING "LC_COLLATE" "LC_CTYPE" t t -1 0 0 1 1663 _null_));
79 SHDESCR("default template for new databases");
80 #define TemplateDbOid 1
81 
82 #endif /* PG_DATABASE_H */
#define BKI_SCHEMA_MACRO
Definition: genbki.h:30
DATA(insert OID=1(template1 PGUID ENCODING"LC_COLLATE""LC_CTYPE"t t-1 0 0 1 1663 _null_))
uint32 TransactionId
Definition: c.h:391
FormData_pg_database * Form_pg_database
Definition: pg_database.h:57
#define BKI_SHARED_RELATION
Definition: genbki.h:27
unsigned int Oid
Definition: postgres_ext.h:31
signed int int32
Definition: c.h:246
SHDESCR("default template for new databases")
Definition: c.h:487
#define BKI_ROWTYPE_OID(oid)
Definition: genbki.h:29
static char * encoding
Definition: initdb.c:123
FormData_pg_database
Definition: pg_database.h:50
CATALOG(pg_database, 1262) BKI_SHARED_RELATION BKI_ROWTYPE_OID(1248) BKI_SCHEMA_MACRO
Definition: pg_database.h:32