1 /*-------------------------------------------------------------------------
4 * definition of the system "authorization identifier" relation (pg_authid)
5 * along with the relation's initial contents.
7 * pg_shadow and pg_group are now publicly accessible views on pg_authid.
10 * Portions Copyright (c) 1996-2014, PostgreSQL Global Development Group
11 * Portions Copyright (c) 1994, Regents of the University of California
13 * src/include/catalog/pg_authid.h
16 * the genbki.pl script reads this file and generates .bki
17 * information from the DATA() statements.
19 *-------------------------------------------------------------------------
24 #include "catalog/genbki.h"
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.
34 #define timestamptz int
38 * pg_authid definition. cpp turns this into
39 * typedef struct FormData_pg_authid
42 #define AuthIdRelationId 1260
43 #define AuthIdRelation_Rowtype_Id 2842
45 CATALOG(pg_authid,1260) BKI_SHARED_RELATION BKI_ROWTYPE_OID(2842) BKI_SCHEMA_MACRO
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) */
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 */
66 * Form_pg_authid corresponds to a pointer to a tuple with
67 * the format of pg_authid relation.
70 typedef FormData_pg_authid *Form_pg_authid;
73 * compiler constants for pg_authid
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
90 * initial contents of pg_authid
92 * The uppercase quantities will be replaced at initdb time with
96 DATA(insert OID = 10 ( "POSTGRES" t t t t t t t -1 _null_ _null_ ));
98 #define BOOTSTRAP_SUPERUSERID 10
100 #endif /* PG_AUTHID_H */