]> granicus.if.org Git - postgresql/blob - src/include/catalog/pg_database.h
Run pgindent on 9.2 source tree in preparation for first 9.3
[postgresql] / src / include / catalog / pg_database.h
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-2012, 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
32 CATALOG(pg_database,1262) BKI_SHARED_RELATION BKI_ROWTYPE_OID(1248) BKI_SCHEMA_MACRO
33 {
34         NameData        datname;                /* database name */
35         Oid                     datdba;                 /* owner of database */
36         int4            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         int4            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         Oid                     dattablespace;  /* default table space for this DB */
45
46 #ifdef CATALOG_VARLEN                   /* variable-length fields start here */
47         aclitem         datacl[1];              /* access permissions */
48 #endif
49 } FormData_pg_database;
50
51 /* ----------------
52  *              Form_pg_database corresponds to a pointer to a tuple with
53  *              the format of pg_database relation.
54  * ----------------
55  */
56 typedef FormData_pg_database *Form_pg_database;
57
58 /* ----------------
59  *              compiler constants for pg_database
60  * ----------------
61  */
62 #define Natts_pg_database                               12
63 #define Anum_pg_database_datname                1
64 #define Anum_pg_database_datdba                 2
65 #define Anum_pg_database_encoding               3
66 #define Anum_pg_database_datcollate             4
67 #define Anum_pg_database_datctype               5
68 #define Anum_pg_database_datistemplate  6
69 #define Anum_pg_database_datallowconn   7
70 #define Anum_pg_database_datconnlimit   8
71 #define Anum_pg_database_datlastsysoid  9
72 #define Anum_pg_database_datfrozenxid   10
73 #define Anum_pg_database_dattablespace  11
74 #define Anum_pg_database_datacl                 12
75
76 DATA(insert OID = 1 (  template1 PGUID ENCODING "LC_COLLATE" "LC_CTYPE" t t -1 0 0 1663 _null_));
77 SHDESCR("default template for new databases");
78 #define TemplateDbOid                   1
79
80 #endif   /* PG_DATABASE_H */