1 /*-------------------------------------------------------------------------
4 * Declarations of tables used by GUC.
6 * See src/backend/utils/misc/README for design notes.
8 * Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group
10 * $PostgreSQL: pgsql/src/include/utils/guc_tables.h,v 1.22 2006/03/05 15:59:07 momjian 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
67 CLIENT_CONN_STATEMENT,
72 COMPAT_OPTIONS_PREVIOUS,
73 COMPAT_OPTIONS_CLIENT,
80 * Stack entry for saving the state of a variable prior to the current
83 typedef struct guc_stack
85 struct guc_stack *prev; /* previous stack item, if any */
86 int nest_level; /* nesting depth of cur transaction */
87 int status; /* previous status bits, see below */
88 GucSource tentative_source; /* source of the tentative_value */
89 GucSource source; /* source of the actual value */
90 union config_var_value tentative_val; /* previous tentative val */
91 union config_var_value value; /* previous actual value */
95 * Generic fields applicable to all types of variables
97 * The short description should be less than 80 chars in length. Some
98 * applications may use the long description as well, and will append
99 * it to the short description. (separated by a newline or '. ')
101 struct config_generic
103 /* constant fields, must be set correctly in initial value: */
104 const char *name; /* name of variable - MUST BE FIRST */
105 GucContext context; /* context required to set the variable */
106 enum config_group group; /* to help organize variables by function */
107 const char *short_desc; /* short desc. of this variable's purpose */
108 const char *long_desc; /* long desc. of this variable's purpose */
109 int flags; /* flag bits, see below */
110 /* variable fields, initialized at runtime: */
111 enum config_type vartype; /* type of variable (set only at startup) */
112 int status; /* status bits, see below */
113 GucSource reset_source; /* source of the reset_value */
114 GucSource tentative_source; /* source of the tentative_value */
115 GucSource source; /* source of the current actual value */
116 GucStack *stack; /* stacked outside-of-transaction states */
119 /* bit values in flags field */
120 #define GUC_LIST_INPUT 0x0001 /* input can be list format */
121 #define GUC_LIST_QUOTE 0x0002 /* double-quote list elements */
122 #define GUC_NO_SHOW_ALL 0x0004 /* exclude from SHOW ALL */
123 #define GUC_NO_RESET_ALL 0x0008 /* exclude from RESET ALL */
124 #define GUC_REPORT 0x0010 /* auto-report changes to client */
125 #define GUC_NOT_IN_SAMPLE 0x0020 /* not in postgresql.conf.sample */
126 #define GUC_DISALLOW_IN_FILE 0x0040 /* can't set in postgresql.conf */
127 #define GUC_CUSTOM_PLACEHOLDER 0x0080 /* placeholder for custom variable */
128 #define GUC_SUPERUSER_ONLY 0x0100 /* show only to superusers */
129 #define GUC_IS_NAME 0x0200 /* limit string to NAMEDATALEN-1 */
131 /* bit values in status field */
132 #define GUC_HAVE_TENTATIVE 0x0001 /* tentative value is defined */
133 #define GUC_HAVE_LOCAL 0x0002 /* a SET LOCAL has been executed */
134 #define GUC_HAVE_STACK 0x0004 /* we have stacked prior value(s) */
137 /* GUC records for specific variable types */
141 struct config_generic gen;
142 /* these fields must be set correctly in initial value: */
143 /* (all but reset_val are constants) */
146 GucBoolAssignHook assign_hook;
147 GucShowHook show_hook;
148 /* variable fields, initialized at runtime: */
154 struct config_generic gen;
155 /* these fields must be set correctly in initial value: */
156 /* (all but reset_val are constants) */
161 GucIntAssignHook assign_hook;
162 GucShowHook show_hook;
163 /* variable fields, initialized at runtime: */
169 struct config_generic gen;
170 /* these fields must be set correctly in initial value: */
171 /* (all but reset_val are constants) */
176 GucRealAssignHook assign_hook;
177 GucShowHook show_hook;
178 /* variable fields, initialized at runtime: */
179 double tentative_val;
184 struct config_generic gen;
185 /* these fields must be set correctly in initial value: */
186 /* (all are constants) */
188 const char *boot_val;
189 GucStringAssignHook assign_hook;
190 GucShowHook show_hook;
191 /* variable fields, initialized at runtime: */
196 /* constant tables corresponding to enums above and in guc.h */
197 extern const char *const config_group_names[];
198 extern const char *const config_type_names[];
199 extern const char *const GucContext_Names[];
200 extern const char *const GucSource_Names[];
202 /* get the current set of variables */
203 extern struct config_generic **get_guc_variables(void);
205 extern void build_guc_variables(void);
207 #endif /* GUC_TABLES_H */