]> granicus.if.org Git - postgresql/blob - src/include/catalog/pg_database.h
Reorganize our CRC source files again.
[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-2015, 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         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
50 } FormData_pg_database;
51
52 /* ----------------
53  *              Form_pg_database corresponds to a pointer to a tuple with
54  *              the format of pg_database relation.
55  * ----------------
56  */
57 typedef FormData_pg_database *Form_pg_database;
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 */