Header And Logo

PostgreSQL
| The world's most advanced open source database.

pg_authid.h

Go to the documentation of this file.
00001 /*-------------------------------------------------------------------------
00002  *
00003  * pg_authid.h
00004  *    definition of the system "authorization identifier" relation (pg_authid)
00005  *    along with the relation's initial contents.
00006  *
00007  *    pg_shadow and pg_group are now publicly accessible views on pg_authid.
00008  *
00009  *
00010  * Portions Copyright (c) 1996-2013, PostgreSQL Global Development Group
00011  * Portions Copyright (c) 1994, Regents of the University of California
00012  *
00013  * src/include/catalog/pg_authid.h
00014  *
00015  * NOTES
00016  *    the genbki.pl script reads this file and generates .bki
00017  *    information from the DATA() statements.
00018  *
00019  *-------------------------------------------------------------------------
00020  */
00021 #ifndef PG_AUTHID_H
00022 #define PG_AUTHID_H
00023 
00024 #include "catalog/genbki.h"
00025 
00026 /*
00027  * The CATALOG definition has to refer to the type of rolvaliduntil as
00028  * "timestamptz" (lower case) so that bootstrap mode recognizes it.  But
00029  * the C header files define this type as TimestampTz.  Since the field is
00030  * potentially-null and therefore can't be accessed directly from C code,
00031  * there is no particular need for the C struct definition to show the
00032  * field type as TimestampTz --- instead we just make it int.
00033  */
00034 #define timestamptz int
00035 
00036 
00037 /* ----------------
00038  *      pg_authid definition.  cpp turns this into
00039  *      typedef struct FormData_pg_authid
00040  * ----------------
00041  */
00042 #define AuthIdRelationId    1260
00043 #define AuthIdRelation_Rowtype_Id   2842
00044 
00045 CATALOG(pg_authid,1260) BKI_SHARED_RELATION BKI_ROWTYPE_OID(2842) BKI_SCHEMA_MACRO
00046 {
00047     NameData    rolname;        /* name of role */
00048     bool        rolsuper;       /* read this field via superuser() only! */
00049     bool        rolinherit;     /* inherit privileges from other roles? */
00050     bool        rolcreaterole;  /* allowed to create more roles? */
00051     bool        rolcreatedb;    /* allowed to create databases? */
00052     bool        rolcatupdate;   /* allowed to alter catalogs manually? */
00053     bool        rolcanlogin;    /* allowed to log in as session user? */
00054     bool        rolreplication; /* role used for streaming replication */
00055     int32       rolconnlimit;   /* max connections allowed (-1=no limit) */
00056 
00057     /* remaining fields may be null; use heap_getattr to read them! */
00058     text        rolpassword;    /* password, if any */
00059     timestamptz rolvaliduntil;  /* password expiration time, if any */
00060 } FormData_pg_authid;
00061 
00062 #undef timestamptz
00063 
00064 
00065 /* ----------------
00066  *      Form_pg_authid corresponds to a pointer to a tuple with
00067  *      the format of pg_authid relation.
00068  * ----------------
00069  */
00070 typedef FormData_pg_authid *Form_pg_authid;
00071 
00072 /* ----------------
00073  *      compiler constants for pg_authid
00074  * ----------------
00075  */
00076 #define Natts_pg_authid                 11
00077 #define Anum_pg_authid_rolname          1
00078 #define Anum_pg_authid_rolsuper         2
00079 #define Anum_pg_authid_rolinherit       3
00080 #define Anum_pg_authid_rolcreaterole    4
00081 #define Anum_pg_authid_rolcreatedb      5
00082 #define Anum_pg_authid_rolcatupdate     6
00083 #define Anum_pg_authid_rolcanlogin      7
00084 #define Anum_pg_authid_rolreplication   8
00085 #define Anum_pg_authid_rolconnlimit     9
00086 #define Anum_pg_authid_rolpassword      10
00087 #define Anum_pg_authid_rolvaliduntil    11
00088 
00089 /* ----------------
00090  *      initial contents of pg_authid
00091  *
00092  * The uppercase quantities will be replaced at initdb time with
00093  * user choices.
00094  * ----------------
00095  */
00096 DATA(insert OID = 10 ( "POSTGRES" t t t t t t t -1 _null_ _null_ ));
00097 
00098 #define BOOTSTRAP_SUPERUSERID 10
00099 
00100 #endif   /* PG_AUTHID_H */