Fix xslt_process() to ensure that it inserts a NULL terminator after the
[PostgreSQL.git] / src / include / utils / guc_tables.h
blob41a294a3af5a9e9371ce5b15d787360bc09b7ba9
1 /*-------------------------------------------------------------------------
3 * guc_tables.h
4 * Declarations of tables used by GUC.
6 * See src/backend/utils/misc/README for design notes.
8 * Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
10 * $PostgreSQL$
12 *-------------------------------------------------------------------------
14 #ifndef GUC_TABLES_H
15 #define GUC_TABLES_H 1
17 #include "utils/guc.h"
20 * GUC supports these types of variables:
22 enum config_type
24 PGC_BOOL,
25 PGC_INT,
26 PGC_REAL,
27 PGC_STRING,
28 PGC_ENUM
31 union config_var_value
33 bool boolval;
34 int intval;
35 double realval;
36 char *stringval;
37 int enumval;
41 * Groupings to help organize all the run-time options for display
43 enum config_group
45 UNGROUPED,
46 FILE_LOCATIONS,
47 CONN_AUTH,
48 CONN_AUTH_SETTINGS,
49 CONN_AUTH_SECURITY,
50 RESOURCES,
51 RESOURCES_MEM,
52 RESOURCES_KERNEL,
53 WAL,
54 WAL_SETTINGS,
55 WAL_CHECKPOINTS,
56 QUERY_TUNING,
57 QUERY_TUNING_METHOD,
58 QUERY_TUNING_COST,
59 QUERY_TUNING_GEQO,
60 QUERY_TUNING_OTHER,
61 LOGGING,
62 LOGGING_WHERE,
63 LOGGING_WHEN,
64 LOGGING_WHAT,
65 STATS,
66 STATS_MONITORING,
67 STATS_COLLECTOR,
68 AUTOVACUUM,
69 CLIENT_CONN,
70 CLIENT_CONN_STATEMENT,
71 CLIENT_CONN_LOCALE,
72 CLIENT_CONN_OTHER,
73 LOCK_MANAGEMENT,
74 COMPAT_OPTIONS,
75 COMPAT_OPTIONS_PREVIOUS,
76 COMPAT_OPTIONS_CLIENT,
77 PRESET_OPTIONS,
78 CUSTOM_OPTIONS,
79 DEVELOPER_OPTIONS
83 * Stack entry for saving the state a variable had prior to an uncommitted
84 * transactional change
86 typedef enum
88 /* This is almost GucAction, but we need a fourth state for SET+LOCAL */
89 GUC_SAVE, /* entry caused by function SET option */
90 GUC_SET, /* entry caused by plain SET command */
91 GUC_LOCAL, /* entry caused by SET LOCAL command */
92 GUC_SET_LOCAL /* entry caused by SET then SET LOCAL */
93 } GucStackState;
95 typedef struct guc_stack
97 struct guc_stack *prev; /* previous stack item, if any */
98 int nest_level; /* nesting depth at which we made entry */
99 GucStackState state; /* see enum above */
100 GucSource source; /* source of the prior value */
101 union config_var_value prior; /* previous value of variable */
102 union config_var_value masked; /* SET value in a GUC_SET_LOCAL entry */
103 /* masked value's source must be PGC_S_SESSION, so no need to store it */
104 } GucStack;
107 * Generic fields applicable to all types of variables
109 * The short description should be less than 80 chars in length. Some
110 * applications may use the long description as well, and will append
111 * it to the short description. (separated by a newline or '. ')
113 struct config_generic
115 /* constant fields, must be set correctly in initial value: */
116 const char *name; /* name of variable - MUST BE FIRST */
117 GucContext context; /* context required to set the variable */
118 enum config_group group; /* to help organize variables by function */
119 const char *short_desc; /* short desc. of this variable's purpose */
120 const char *long_desc; /* long desc. of this variable's purpose */
121 int flags; /* flag bits, see below */
122 /* variable fields, initialized at runtime: */
123 enum config_type vartype; /* type of variable (set only at startup) */
124 int status; /* status bits, see below */
125 GucSource reset_source; /* source of the reset_value */
126 GucSource source; /* source of the current actual value */
127 GucStack *stack; /* stacked prior values */
128 char *sourcefile; /* file this settings is from (NULL if not
129 * file) */
130 int sourceline; /* line in source file */
133 /* bit values in flags field are defined in guc.h */
135 /* bit values in status field */
136 #define GUC_IS_IN_FILE 0x0001 /* found it in config file */
138 * Caution: the GUC_IS_IN_FILE bit is transient state for ProcessConfigFile.
139 * Do not assume that its value represents useful information elsewhere.
143 /* GUC records for specific variable types */
145 struct config_bool
147 struct config_generic gen;
148 /* constant fields, must be set correctly in initial value: */
149 bool *variable;
150 bool boot_val;
151 GucBoolAssignHook assign_hook;
152 GucShowHook show_hook;
153 /* variable fields, initialized at runtime: */
154 bool reset_val;
157 struct config_int
159 struct config_generic gen;
160 /* constant fields, must be set correctly in initial value: */
161 int *variable;
162 int boot_val;
163 int min;
164 int max;
165 GucIntAssignHook assign_hook;
166 GucShowHook show_hook;
167 /* variable fields, initialized at runtime: */
168 int reset_val;
171 struct config_real
173 struct config_generic gen;
174 /* constant fields, must be set correctly in initial value: */
175 double *variable;
176 double boot_val;
177 double min;
178 double max;
179 GucRealAssignHook assign_hook;
180 GucShowHook show_hook;
181 /* variable fields, initialized at runtime: */
182 double reset_val;
185 struct config_string
187 struct config_generic gen;
188 /* constant fields, must be set correctly in initial value: */
189 char **variable;
190 const char *boot_val;
191 GucStringAssignHook assign_hook;
192 GucShowHook show_hook;
193 /* variable fields, initialized at runtime: */
194 char *reset_val;
197 struct config_enum
199 struct config_generic gen;
200 /* constant fields, must be set correctly in initial value: */
201 int *variable;
202 int boot_val;
203 const struct config_enum_entry *options;
204 GucEnumAssignHook assign_hook;
205 GucShowHook show_hook;
206 /* variable fields, initialized at runtime: */
207 int reset_val;
210 /* constant tables corresponding to enums above and in guc.h */
211 extern const char *const config_group_names[];
212 extern const char *const config_type_names[];
213 extern const char *const GucContext_Names[];
214 extern const char *const GucSource_Names[];
216 /* get the current set of variables */
217 extern struct config_generic **get_guc_variables(void);
219 extern void build_guc_variables(void);
221 /* search in enum options */
222 extern const char *config_enum_lookup_by_value(struct config_enum * record, int val);
223 extern bool config_enum_lookup_by_name(struct config_enum * record,
224 const char *value, int *retval);
227 #endif /* GUC_TABLES_H */