00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #ifndef GUC_TABLES_H
00015 #define GUC_TABLES_H 1
00016
00017 #include "utils/guc.h"
00018
00019
00020
00021
00022 enum config_type
00023 {
00024 PGC_BOOL,
00025 PGC_INT,
00026 PGC_REAL,
00027 PGC_STRING,
00028 PGC_ENUM
00029 };
00030
00031 union config_var_val
00032 {
00033 bool boolval;
00034 int intval;
00035 double realval;
00036 char *stringval;
00037 int enumval;
00038 };
00039
00040
00041
00042
00043
00044 typedef struct config_var_value
00045 {
00046 union config_var_val val;
00047 void *extra;
00048 } config_var_value;
00049
00050
00051
00052
00053 enum config_group
00054 {
00055 UNGROUPED,
00056 FILE_LOCATIONS,
00057 CONN_AUTH,
00058 CONN_AUTH_SETTINGS,
00059 CONN_AUTH_SECURITY,
00060 RESOURCES,
00061 RESOURCES_MEM,
00062 RESOURCES_DISK,
00063 RESOURCES_KERNEL,
00064 RESOURCES_VACUUM_DELAY,
00065 RESOURCES_BGWRITER,
00066 RESOURCES_ASYNCHRONOUS,
00067 WAL,
00068 WAL_SETTINGS,
00069 WAL_CHECKPOINTS,
00070 WAL_ARCHIVING,
00071 REPLICATION,
00072 REPLICATION_SENDING,
00073 REPLICATION_MASTER,
00074 REPLICATION_STANDBY,
00075 QUERY_TUNING,
00076 QUERY_TUNING_METHOD,
00077 QUERY_TUNING_COST,
00078 QUERY_TUNING_GEQO,
00079 QUERY_TUNING_OTHER,
00080 LOGGING,
00081 LOGGING_WHERE,
00082 LOGGING_WHEN,
00083 LOGGING_WHAT,
00084 STATS,
00085 STATS_MONITORING,
00086 STATS_COLLECTOR,
00087 AUTOVACUUM,
00088 CLIENT_CONN,
00089 CLIENT_CONN_STATEMENT,
00090 CLIENT_CONN_LOCALE,
00091 CLIENT_CONN_OTHER,
00092 LOCK_MANAGEMENT,
00093 COMPAT_OPTIONS,
00094 COMPAT_OPTIONS_PREVIOUS,
00095 COMPAT_OPTIONS_CLIENT,
00096 ERROR_HANDLING_OPTIONS,
00097 PRESET_OPTIONS,
00098 CUSTOM_OPTIONS,
00099 DEVELOPER_OPTIONS
00100 };
00101
00102
00103
00104
00105
00106 typedef enum
00107 {
00108
00109 GUC_SAVE,
00110 GUC_SET,
00111 GUC_LOCAL,
00112 GUC_SET_LOCAL
00113 } GucStackState;
00114
00115 typedef struct guc_stack
00116 {
00117 struct guc_stack *prev;
00118 int nest_level;
00119 GucStackState state;
00120 GucSource source;
00121
00122 GucContext scontext;
00123 GucContext masked_scontext;
00124 config_var_value prior;
00125 config_var_value masked;
00126 } GucStack;
00127
00128
00129
00130
00131
00132
00133
00134
00135
00136
00137
00138
00139
00140 struct config_generic
00141 {
00142
00143 const char *name;
00144 GucContext context;
00145 enum config_group group;
00146 const char *short_desc;
00147 const char *long_desc;
00148 int flags;
00149
00150 enum config_type vartype;
00151 int status;
00152 GucSource source;
00153 GucSource reset_source;
00154 GucContext scontext;
00155 GucContext reset_scontext;
00156 GucStack *stack;
00157 void *extra;
00158 char *sourcefile;
00159
00160 int sourceline;
00161 };
00162
00163
00164 #define GUC_IS_IN_FILE 0x0001
00165
00166
00167
00168
00169
00170
00171
00172
00173 struct config_bool
00174 {
00175 struct config_generic gen;
00176
00177 bool *variable;
00178 bool boot_val;
00179 GucBoolCheckHook check_hook;
00180 GucBoolAssignHook assign_hook;
00181 GucShowHook show_hook;
00182
00183 bool reset_val;
00184 void *reset_extra;
00185 };
00186
00187 struct config_int
00188 {
00189 struct config_generic gen;
00190
00191 int *variable;
00192 int boot_val;
00193 int min;
00194 int max;
00195 GucIntCheckHook check_hook;
00196 GucIntAssignHook assign_hook;
00197 GucShowHook show_hook;
00198
00199 int reset_val;
00200 void *reset_extra;
00201 };
00202
00203 struct config_real
00204 {
00205 struct config_generic gen;
00206
00207 double *variable;
00208 double boot_val;
00209 double min;
00210 double max;
00211 GucRealCheckHook check_hook;
00212 GucRealAssignHook assign_hook;
00213 GucShowHook show_hook;
00214
00215 double reset_val;
00216 void *reset_extra;
00217 };
00218
00219 struct config_string
00220 {
00221 struct config_generic gen;
00222
00223 char **variable;
00224 const char *boot_val;
00225 GucStringCheckHook check_hook;
00226 GucStringAssignHook assign_hook;
00227 GucShowHook show_hook;
00228
00229 char *reset_val;
00230 void *reset_extra;
00231 };
00232
00233 struct config_enum
00234 {
00235 struct config_generic gen;
00236
00237 int *variable;
00238 int boot_val;
00239 const struct config_enum_entry *options;
00240 GucEnumCheckHook check_hook;
00241 GucEnumAssignHook assign_hook;
00242 GucShowHook show_hook;
00243
00244 int reset_val;
00245 void *reset_extra;
00246 };
00247
00248
00249 extern const char *const config_group_names[];
00250 extern const char *const config_type_names[];
00251 extern const char *const GucContext_Names[];
00252 extern const char *const GucSource_Names[];
00253
00254
00255 extern struct config_generic **get_guc_variables(void);
00256
00257 extern void build_guc_variables(void);
00258
00259
00260 extern const char *config_enum_lookup_by_value(struct config_enum * record, int val);
00261 extern bool config_enum_lookup_by_name(struct config_enum * record,
00262 const char *value, int *retval);
00263
00264
00265 #endif