]> granicus.if.org Git - postgresql/blob - src/include/catalog/pg_authid.h
Update copyright for 2014
[postgresql] / src / include / catalog / pg_authid.h
1 /*-------------------------------------------------------------------------
2  *
3  * pg_authid.h
4  *        definition of the system "authorization identifier" relation (pg_authid)
5  *        along with the relation's initial contents.
6  *
7  *        pg_shadow and pg_group are now publicly accessible views on pg_authid.
8  *
9  *
10  * Portions Copyright (c) 1996-2014, PostgreSQL Global Development Group
11  * Portions Copyright (c) 1994, Regents of the University of California
12  *
13  * src/include/catalog/pg_authid.h
14  *
15  * NOTES
16  *        the genbki.pl script reads this file and generates .bki
17  *        information from the DATA() statements.
18  *
19  *-------------------------------------------------------------------------
20  */
21 #ifndef PG_AUTHID_H
22 #define PG_AUTHID_H
23
24 #include "catalog/genbki.h"
25
26 /*
27  * The CATALOG definition has to refer to the type of rolvaliduntil as
28  * "timestamptz" (lower case) so that bootstrap mode recognizes it.  But
29  * the C header files define this type as TimestampTz.  Since the field is
30  * potentially-null and therefore can't be accessed directly from C code,
31  * there is no particular need for the C struct definition to show the
32  * field type as TimestampTz --- instead we just make it int.
33  */
34 #define timestamptz int
35
36
37 /* ----------------
38  *              pg_authid definition.  cpp turns this into
39  *              typedef struct FormData_pg_authid
40  * ----------------
41  */
42 #define AuthIdRelationId        1260
43 #define AuthIdRelation_Rowtype_Id       2842
44
45 CATALOG(pg_authid,1260) BKI_SHARED_RELATION BKI_ROWTYPE_OID(2842) BKI_SCHEMA_MACRO
46 {
47         NameData        rolname;                /* name of role */
48         bool            rolsuper;               /* read this field via superuser() only! */
49         bool            rolinherit;             /* inherit privileges from other roles? */
50         bool            rolcreaterole;  /* allowed to create more roles? */
51         bool            rolcreatedb;    /* allowed to create databases? */
52         bool            rolcatupdate;   /* allowed to alter catalogs manually? */
53         bool            rolcanlogin;    /* allowed to log in as session user? */
54         bool            rolreplication; /* role used for streaming replication */
55         int32           rolconnlimit;   /* max connections allowed (-1=no limit) */
56
57         /* remaining fields may be null; use heap_getattr to read them! */
58         text            rolpassword;    /* password, if any */
59         timestamptz rolvaliduntil;      /* password expiration time, if any */
60 } FormData_pg_authid;
61
62 #undef timestamptz
63
64
65 /* ----------------
66  *              Form_pg_authid corresponds to a pointer to a tuple with
67  *              the format of pg_authid relation.
68  * ----------------
69  */
70 typedef FormData_pg_authid *Form_pg_authid;
71
72 /* ----------------
73  *              compiler constants for pg_authid
74  * ----------------
75  */
76 #define Natts_pg_authid                                 11
77 #define Anum_pg_authid_rolname                  1
78 #define Anum_pg_authid_rolsuper                 2
79 #define Anum_pg_authid_rolinherit               3
80 #define Anum_pg_authid_rolcreaterole    4
81 #define Anum_pg_authid_rolcreatedb              5
82 #define Anum_pg_authid_rolcatupdate             6
83 #define Anum_pg_authid_rolcanlogin              7
84 #define Anum_pg_authid_rolreplication   8
85 #define Anum_pg_authid_rolconnlimit             9
86 #define Anum_pg_authid_rolpassword              10
87 #define Anum_pg_authid_rolvaliduntil    11
88
89 /* ----------------
90  *              initial contents of pg_authid
91  *
92  * The uppercase quantities will be replaced at initdb time with
93  * user choices.
94  * ----------------
95  */
96 DATA(insert OID = 10 ( "POSTGRES" t t t t t t t -1 _null_ _null_ ));
97
98 #define BOOTSTRAP_SUPERUSERID 10
99
100 #endif   /* PG_AUTHID_H */