1 /*-------------------------------------------------------------------------
4 * Declarations of tables used by GUC.
6 * See src/backend/utils/misc/README for design notes.
8 * Portions Copyright (c) 1996-2004, PostgreSQL Global Development Group
10 * $PostgreSQL: pgsql/src/include/utils/guc_tables.h,v 1.17 2004/10/08 01:36:36 tgl Exp $
12 *-------------------------------------------------------------------------
15 #define GUC_TABLES_H 1
18 * GUC supports these types of variables:
28 union config_var_value
37 * Groupings to help organize all the run-time options for display
66 CLIENT_CONN_STATEMENT,
71 COMPAT_OPTIONS_PREVIOUS,
72 COMPAT_OPTIONS_CLIENT,
79 * Stack entry for saving the state of a variable prior to the current
82 typedef struct guc_stack
84 struct guc_stack *prev; /* previous stack item, if any */
85 int nest_level; /* nesting depth of cur transaction */
86 int status; /* previous status bits, see below */
87 GucSource tentative_source; /* source of the tentative_value */
88 GucSource source; /* source of the actual value */
89 union config_var_value tentative_val; /* previous tentative val */
90 union config_var_value value; /* previous actual value */
94 * Generic fields applicable to all types of variables
96 * The short description should be less than 80 chars in length. Some
97 * applications may use the long description as well, and will append
98 * it to the short description. (separated by a newline or '. ')
100 struct config_generic
102 /* constant fields, must be set correctly in initial value: */
103 const char *name; /* name of variable - MUST BE FIRST */
104 GucContext context; /* context required to set the variable */
105 enum config_group group; /* to help organize variables by function */
106 const char *short_desc; /* short desc. of this variable's purpose */
107 const char *long_desc; /* long desc. of this variable's purpose */
108 int flags; /* flag bits, see below */
109 /* variable fields, initialized at runtime: */
110 enum config_type vartype; /* type of variable (set only at startup) */
111 int status; /* status bits, see below */
112 GucSource reset_source; /* source of the reset_value */
113 GucSource tentative_source; /* source of the tentative_value */
114 GucSource source; /* source of the current actual value */
115 GucStack *stack; /* stacked outside-of-transaction states */
118 /* bit values in flags field */
119 #define GUC_LIST_INPUT 0x0001 /* input can be list format */
120 #define GUC_LIST_QUOTE 0x0002 /* double-quote list elements */
121 #define GUC_NO_SHOW_ALL 0x0004 /* exclude from SHOW ALL */
122 #define GUC_NO_RESET_ALL 0x0008 /* exclude from RESET ALL */
123 #define GUC_REPORT 0x0010 /* auto-report changes to client */
124 #define GUC_NOT_IN_SAMPLE 0x0020 /* not in postgresql.conf.sample */
125 #define GUC_DISALLOW_IN_FILE 0x0040 /* can't set in postgresql.conf */
126 #define GUC_CUSTOM_PLACEHOLDER 0x0080 /* placeholder for a custom
129 /* bit values in status field */
130 #define GUC_HAVE_TENTATIVE 0x0001 /* tentative value is defined */
131 #define GUC_HAVE_LOCAL 0x0002 /* a SET LOCAL has been executed */
132 #define GUC_HAVE_STACK 0x0004 /* we have stacked prior value(s) */
135 /* GUC records for specific variable types */
139 struct config_generic gen;
140 /* these fields must be set correctly in initial value: */
141 /* (all but reset_val are constants) */
144 GucBoolAssignHook assign_hook;
145 GucShowHook show_hook;
146 /* variable fields, initialized at runtime: */
152 struct config_generic gen;
153 /* these fields must be set correctly in initial value: */
154 /* (all but reset_val are constants) */
159 GucIntAssignHook assign_hook;
160 GucShowHook show_hook;
161 /* variable fields, initialized at runtime: */
167 struct config_generic gen;
168 /* these fields must be set correctly in initial value: */
169 /* (all but reset_val are constants) */
174 GucRealAssignHook assign_hook;
175 GucShowHook show_hook;
176 /* variable fields, initialized at runtime: */
177 double tentative_val;
182 struct config_generic gen;
183 /* these fields must be set correctly in initial value: */
184 /* (all are constants) */
186 const char *boot_val;
187 GucStringAssignHook assign_hook;
188 GucShowHook show_hook;
189 /* variable fields, initialized at runtime: */
194 /* constant tables corresponding to enums above and in guc.h */
195 extern const char *const config_group_names[];
196 extern const char *const config_type_names[];
197 extern const char *const GucContext_Names[];
198 extern const char *const GucSource_Names[];
200 /* get the current set of variables */
201 extern struct config_generic **get_guc_variables(void);
203 extern void build_guc_variables(void);
205 #endif /* GUC_TABLES_H */