]> granicus.if.org Git - postgresql/blob - src/include/catalog/pg_database.h
Add per-user and per-database connection limit options.
[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-2005, PostgreSQL Global Development Group
9  * Portions Copyright (c) 1994, Regents of the University of California
10  *
11  * $PostgreSQL: pgsql/src/include/catalog/pg_database.h,v 1.37 2005/07/31 17:19:21 tgl Exp $
12  *
13  * NOTES
14  *        the genbki.sh 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 /* ----------------
23  *              postgres.h contains the system type definitions and the
24  *              CATALOG(), BKI_BOOTSTRAP and DATA() sugar words so this file
25  *              can be read by both genbki.sh and the C compiler.
26  * ----------------
27  */
28
29 /* ----------------
30  *              pg_database definition.  cpp turns this into
31  *              typedef struct FormData_pg_database
32  * ----------------
33  */
34 #define DatabaseRelationId  1262
35
36 CATALOG(pg_database,1262) BKI_SHARED_RELATION
37 {
38         NameData        datname;                /* database name */
39         Oid                     datdba;                 /* owner of database */
40         int4            encoding;               /* character encoding */
41         bool            datistemplate;  /* allowed as CREATE DATABASE template? */
42         bool            datallowconn;   /* new connections allowed? */
43         int4            datconnlimit;   /* max connections allowed (-1=no limit) */
44         Oid                     datlastsysoid;  /* highest OID to consider a system OID */
45         TransactionId datvacuumxid; /* all XIDs before this are vacuumed */
46         TransactionId datfrozenxid; /* all XIDs before this are frozen */
47         Oid                     dattablespace;  /* default table space for this DB */
48         text            datconfig[1];   /* database-specific GUC (VAR LENGTH) */
49         aclitem         datacl[1];              /* access permissions (VAR LENGTH) */
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                               12
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_datistemplate  4
68 #define Anum_pg_database_datallowconn   5
69 #define Anum_pg_database_datconnlimit   6
70 #define Anum_pg_database_datlastsysoid  7
71 #define Anum_pg_database_datvacuumxid   8
72 #define Anum_pg_database_datfrozenxid   9
73 #define Anum_pg_database_dattablespace  10
74 #define Anum_pg_database_datconfig              11
75 #define Anum_pg_database_datacl                 12
76
77 DATA(insert OID = 1 (  template1 PGUID ENCODING t t -1 0 0 0 1663 _null_ _null_ ));
78 DESCR("Default template database");
79 #define TemplateDbOid                   1
80
81 #endif   /* PG_DATABASE_H */