1 /*-------------------------------------------------------------------------
4 * Declarations of tables used by GUC.
6 * See src/backend/utils/misc/README for design notes.
8 * Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
10 * $Id: guc_tables.h,v 1.6 2003/08/04 02:40:15 momjian Exp $
12 *-------------------------------------------------------------------------
18 * Groupings to help organize all the run-time options for display
46 CLIENT_CONN_STATEMENT,
51 COMPAT_OPTIONS_PREVIOUS,
52 COMPAT_OPTIONS_CLIENT,
57 * GUC supports these types of variables:
68 * Generic fields applicable to all types of variables
70 * The short description should be less than 80 chars in length. Some
71 * applications may use the long description as well, and will append
72 * it to the short description. (separated by a newline or '. ')
76 /* constant fields, must be set correctly in initial value: */
77 const char *name; /* name of variable - MUST BE FIRST */
78 GucContext context; /* context required to set the variable */
79 enum config_group group; /* to help organize variables by function */
80 const char *short_desc; /* short desc. of this variable's purpose */
81 const char *long_desc; /* long desc. of this variable's purpose */
82 int flags; /* flag bits, see below */
83 /* variable fields, initialized at runtime: */
84 enum config_type vartype; /* type of variable (set only at startup) */
85 int status; /* status bits, see below */
86 GucSource reset_source; /* source of the reset_value */
87 GucSource session_source; /* source of the session_value */
88 GucSource tentative_source; /* source of the tentative_value */
89 GucSource source; /* source of the current actual value */
92 /* bit values in flags field */
93 #define GUC_LIST_INPUT 0x0001 /* input can be list format */
94 #define GUC_LIST_QUOTE 0x0002 /* double-quote list elements */
95 #define GUC_NO_SHOW_ALL 0x0004 /* exclude from SHOW ALL */
96 #define GUC_NO_RESET_ALL 0x0008 /* exclude from RESET ALL */
97 #define GUC_REPORT 0x0010 /* auto-report changes to client */
98 #define GUC_NOT_IN_SAMPLE 0x0020 /* not in postgresql.conf.sample */
99 #define GUC_DISALLOW_IN_FILE 0x0040 /* can't set in postgresql.conf */
101 /* bit values in status field */
102 #define GUC_HAVE_TENTATIVE 0x0001 /* tentative value is defined */
103 #define GUC_HAVE_LOCAL 0x0002 /* a SET LOCAL has been executed */
106 /* GUC records for specific variable types */
110 struct config_generic gen;
111 /* these fields must be set correctly in initial value: */
112 /* (all but reset_val are constants) */
115 bool (*assign_hook) (bool newval, bool doit, bool interactive);
116 const char *(*show_hook) (void);
117 /* variable fields, initialized at runtime: */
124 struct config_generic gen;
125 /* these fields must be set correctly in initial value: */
126 /* (all but reset_val are constants) */
131 bool (*assign_hook) (int newval, bool doit, bool interactive);
132 const char *(*show_hook) (void);
133 /* variable fields, initialized at runtime: */
140 struct config_generic gen;
141 /* these fields must be set correctly in initial value: */
142 /* (all but reset_val are constants) */
147 bool (*assign_hook) (double newval, bool doit, bool interactive);
148 const char *(*show_hook) (void);
149 /* variable fields, initialized at runtime: */
151 double tentative_val;
156 struct config_generic gen;
157 /* these fields must be set correctly in initial value: */
158 /* (all are constants) */
160 const char *boot_val;
161 const char *(*assign_hook) (const char *newval, bool doit, bool interactive);
162 const char *(*show_hook) (void);
163 /* variable fields, initialized at runtime: */
169 /* constant tables corresponding to enums above and in guc.h */
170 extern const char *const config_group_names[];
171 extern const char *const config_type_names[];
172 extern const char *const GucContext_Names[];
173 extern const char *const GucSource_Names[];
175 /* the current set of variables */
176 extern struct config_generic **guc_variables;
177 extern int num_guc_variables;
179 extern void build_guc_variables(void);