]> granicus.if.org Git - postgresql/blob - src/include/catalog/pg_authid.h
Phase 2 of pgindent updates.
[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-2017, 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            rolcanlogin;    /* allowed to log in as session user? */
53         bool            rolreplication; /* role used for streaming replication */
54         bool            rolbypassrls;   /* bypasses row level security? */
55         int32           rolconnlimit;   /* max connections allowed (-1=no limit) */
56
57         /* remaining fields may be null; use heap_getattr to read them! */
58 #ifdef CATALOG_VARLEN                   /* variable-length fields start here */
59         text            rolpassword;    /* password, if any */
60         timestamptz rolvaliduntil;      /* password expiration time, if any */
61 #endif
62 } FormData_pg_authid;
63
64 #undef timestamptz
65
66
67 /* ----------------
68  *              Form_pg_authid corresponds to a pointer to a tuple with
69  *              the format of pg_authid relation.
70  * ----------------
71  */
72 typedef FormData_pg_authid *Form_pg_authid;
73
74 /* ----------------
75  *              compiler constants for pg_authid
76  * ----------------
77  */
78 #define Natts_pg_authid                                 11
79 #define Anum_pg_authid_rolname                  1
80 #define Anum_pg_authid_rolsuper                 2
81 #define Anum_pg_authid_rolinherit               3
82 #define Anum_pg_authid_rolcreaterole    4
83 #define Anum_pg_authid_rolcreatedb              5
84 #define Anum_pg_authid_rolcanlogin              6
85 #define Anum_pg_authid_rolreplication   7
86 #define Anum_pg_authid_rolbypassrls             8
87 #define Anum_pg_authid_rolconnlimit             9
88 #define Anum_pg_authid_rolpassword              10
89 #define Anum_pg_authid_rolvaliduntil    11
90
91 /* ----------------
92  *              initial contents of pg_authid
93  *
94  * The uppercase quantities will be replaced at initdb time with
95  * user choices.
96  *
97  * The C code typically refers to these roles using the #define symbols,
98  * so be sure to keep those in sync with the DATA lines.
99  * ----------------
100  */
101 DATA(insert OID = 10 ( "POSTGRES" t t t t t t t -1 _null_ _null_));
102 #define BOOTSTRAP_SUPERUSERID                   10
103 DATA(insert OID = 3373 ( "pg_monitor" f t f f f f f -1 _null_ _null_));
104 #define DEFAULT_ROLE_MONITOR            3373
105 DATA(insert OID = 3374 ( "pg_read_all_settings" f t f f f f f -1 _null_ _null_));
106 #define DEFAULT_ROLE_READ_ALL_SETTINGS  3374
107 DATA(insert OID = 3375 ( "pg_read_all_stats" f t f f f f f -1 _null_ _null_));
108 #define DEFAULT_ROLE_READ_ALL_STATS 3375
109 DATA(insert OID = 3377 ( "pg_stat_scan_tables" f t f f f f f -1 _null_ _null_));
110 #define DEFAULT_ROLE_STAT_SCAN_TABLES   3377
111 DATA(insert OID = 4200 ( "pg_signal_backend" f t f f f f f -1 _null_ _null_));
112 #define DEFAULT_ROLE_SIGNAL_BACKENDID   4200
113
114 #endif                                                  /* PG_AUTHID_H */