1 /*-------------------------------------------------------------------------
2  *
3  * pg_db_role_setting.h
4  *	definition of configuration settings
5  *
6  *
7  * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
8  * Portions Copyright (c) 1994, Regents of the University of California
9  *
10  * src/include/catalog/pg_db_role_setting.h
11  *
12  * NOTES
13  *		the genbki.pl script reads this file and generates .bki
14  *		information from the DATA() statements.
15  *
16  *		XXX do NOT break up DATA() statements into multiple lines!
17  *			the scripts are not as smart as you might think...
18  *
19  *-------------------------------------------------------------------------
20  */
21 #ifndef PG_DB_ROLE_SETTING_H
22 #define PG_DB_ROLE_SETTING_H
23 
24 #include "utils/guc.h"
25 #include "utils/relcache.h"
26 #include "utils/snapshot.h"
27 
28 /* ----------------
29  *		pg_db_role_setting definition.  cpp turns this into
30  *		typedef struct FormData_pg_db_role_setting
31  * ----------------
32  */
33 #define DbRoleSettingRelationId 2964
34 
35 CATALOG(pg_db_role_setting,2964) BKI_SHARED_RELATION BKI_WITHOUT_OIDS
36 {
37 	Oid			setdatabase;	/* database */
38 	Oid			setrole;		/* role */
39 
40 #ifdef CATALOG_VARLEN			/* variable-length fields start here */
41 	text		setconfig[1];	/* GUC settings to apply at login */
42 #endif
43 } FormData_pg_db_role_setting;
44 
45 typedef FormData_pg_db_role_setting *Form_pg_db_role_setting;
46 
47 /* ----------------
48  *		compiler constants for pg_db_role_setting
49  * ----------------
50  */
51 #define Natts_pg_db_role_setting				3
52 #define Anum_pg_db_role_setting_setdatabase		1
53 #define Anum_pg_db_role_setting_setrole			2
54 #define Anum_pg_db_role_setting_setconfig		3
55 
56 /* ----------------
57  *		initial contents of pg_db_role_setting are NOTHING
58  * ----------------
59  */
60 
61 /*
62  * prototypes for functions in pg_db_role_setting.h
63  */
64 extern void AlterSetting(Oid databaseid, Oid roleid, VariableSetStmt *setstmt);
65 extern void DropSetting(Oid databaseid, Oid roleid);
66 extern void ApplySetting(Snapshot snapshot, Oid databaseid, Oid roleid,
67 			 Relation relsetting, GucSource source);
68 
69 #endif   /* PG_DB_ROLE_SETTING_H */
70