Eneboo - Documentación para desarrolladores
|
00001 /*------------------------------------------------------------------------- 00002 * 00003 * guc_tables.h 00004 * Declarations of tables used by GUC. 00005 * 00006 * See src/backend/utils/misc/README for design notes. 00007 * 00008 * Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group 00009 * 00010 * $PostgreSQL: pgsql/src/include/utils/guc_tables.h,v 1.20.2.1 2006/02/12 22:32:57 tgl Exp $ 00011 * 00012 *------------------------------------------------------------------------- 00013 */ 00014 #ifndef GUC_TABLES_H 00015 #define GUC_TABLES_H 1 00016 00017 /* 00018 * GUC supports these types of variables: 00019 */ 00020 enum config_type 00021 { 00022 PGC_BOOL, 00023 PGC_INT, 00024 PGC_REAL, 00025 PGC_STRING 00026 }; 00027 00028 union config_var_value 00029 { 00030 bool boolval; 00031 int intval; 00032 double realval; 00033 char *stringval; 00034 }; 00035 00036 /* 00037 * Groupings to help organize all the run-time options for display 00038 */ 00039 enum config_group 00040 { 00041 UNGROUPED, 00042 FILE_LOCATIONS, 00043 CONN_AUTH, 00044 CONN_AUTH_SETTINGS, 00045 CONN_AUTH_SECURITY, 00046 RESOURCES, 00047 RESOURCES_MEM, 00048 RESOURCES_FSM, 00049 RESOURCES_KERNEL, 00050 WAL, 00051 WAL_SETTINGS, 00052 WAL_CHECKPOINTS, 00053 QUERY_TUNING, 00054 QUERY_TUNING_METHOD, 00055 QUERY_TUNING_COST, 00056 QUERY_TUNING_GEQO, 00057 QUERY_TUNING_OTHER, 00058 LOGGING, 00059 LOGGING_WHERE, 00060 LOGGING_WHEN, 00061 LOGGING_WHAT, 00062 STATS, 00063 STATS_MONITORING, 00064 STATS_COLLECTOR, 00065 AUTOVACUUM, 00066 CLIENT_CONN, 00067 CLIENT_CONN_STATEMENT, 00068 CLIENT_CONN_LOCALE, 00069 CLIENT_CONN_OTHER, 00070 LOCK_MANAGEMENT, 00071 COMPAT_OPTIONS, 00072 COMPAT_OPTIONS_PREVIOUS, 00073 COMPAT_OPTIONS_CLIENT, 00074 PRESET_OPTIONS, 00075 CUSTOM_OPTIONS, 00076 DEVELOPER_OPTIONS 00077 }; 00078 00079 /* 00080 * Stack entry for saving the state of a variable prior to the current 00081 * transaction 00082 */ 00083 typedef struct guc_stack 00084 { 00085 struct guc_stack *prev; /* previous stack item, if any */ 00086 int nest_level; /* nesting depth of cur transaction */ 00087 int status; /* previous status bits, see below */ 00088 GucSource tentative_source; /* source of the tentative_value */ 00089 GucSource source; /* source of the actual value */ 00090 union config_var_value tentative_val; /* previous tentative val */ 00091 union config_var_value value; /* previous actual value */ 00092 } GucStack; 00093 00094 /* 00095 * Generic fields applicable to all types of variables 00096 * 00097 * The short description should be less than 80 chars in length. Some 00098 * applications may use the long description as well, and will append 00099 * it to the short description. (separated by a newline or '. ') 00100 */ 00101 struct config_generic 00102 { 00103 /* constant fields, must be set correctly in initial value: */ 00104 const char *name; /* name of variable - MUST BE FIRST */ 00105 GucContext context; /* context required to set the variable */ 00106 enum config_group group; /* to help organize variables by function */ 00107 const char *short_desc; /* short desc. of this variable's purpose */ 00108 const char *long_desc; /* long desc. of this variable's purpose */ 00109 int flags; /* flag bits, see below */ 00110 /* variable fields, initialized at runtime: */ 00111 enum config_type vartype; /* type of variable (set only at startup) */ 00112 int status; /* status bits, see below */ 00113 GucSource reset_source; /* source of the reset_value */ 00114 GucSource tentative_source; /* source of the tentative_value */ 00115 GucSource source; /* source of the current actual value */ 00116 GucStack *stack; /* stacked outside-of-transaction states */ 00117 }; 00118 00119 /* bit values in flags field */ 00120 #define GUC_LIST_INPUT 0x0001 /* input can be list format */ 00121 #define GUC_LIST_QUOTE 0x0002 /* double-quote list elements */ 00122 #define GUC_NO_SHOW_ALL 0x0004 /* exclude from SHOW ALL */ 00123 #define GUC_NO_RESET_ALL 0x0008 /* exclude from RESET ALL */ 00124 #define GUC_REPORT 0x0010 /* auto-report changes to client */ 00125 #define GUC_NOT_IN_SAMPLE 0x0020 /* not in postgresql.conf.sample */ 00126 #define GUC_DISALLOW_IN_FILE 0x0040 /* can't set in postgresql.conf */ 00127 #define GUC_CUSTOM_PLACEHOLDER 0x0080 /* placeholder for custom variable */ 00128 #define GUC_SUPERUSER_ONLY 0x0100 /* show only to superusers */ 00129 #define GUC_IS_NAME 0x0200 /* limit string to NAMEDATALEN-1 */ 00130 00131 /* bit values in status field */ 00132 #define GUC_HAVE_TENTATIVE 0x0001 /* tentative value is defined */ 00133 #define GUC_HAVE_LOCAL 0x0002 /* a SET LOCAL has been executed */ 00134 #define GUC_HAVE_STACK 0x0004 /* we have stacked prior value(s) */ 00135 00136 00137 /* GUC records for specific variable types */ 00138 00139 struct config_bool 00140 { 00141 struct config_generic gen; 00142 /* these fields must be set correctly in initial value: */ 00143 /* (all but reset_val are constants) */ 00144 bool *variable; 00145 bool reset_val; 00146 GucBoolAssignHook assign_hook; 00147 GucShowHook show_hook; 00148 /* variable fields, initialized at runtime: */ 00149 bool tentative_val; 00150 }; 00151 00152 struct config_int 00153 { 00154 struct config_generic gen; 00155 /* these fields must be set correctly in initial value: */ 00156 /* (all but reset_val are constants) */ 00157 int *variable; 00158 int reset_val; 00159 int min; 00160 int max; 00161 GucIntAssignHook assign_hook; 00162 GucShowHook show_hook; 00163 /* variable fields, initialized at runtime: */ 00164 int tentative_val; 00165 }; 00166 00167 struct config_real 00168 { 00169 struct config_generic gen; 00170 /* these fields must be set correctly in initial value: */ 00171 /* (all but reset_val are constants) */ 00172 double *variable; 00173 double reset_val; 00174 double min; 00175 double max; 00176 GucRealAssignHook assign_hook; 00177 GucShowHook show_hook; 00178 /* variable fields, initialized at runtime: */ 00179 double tentative_val; 00180 }; 00181 00182 struct config_string 00183 { 00184 struct config_generic gen; 00185 /* these fields must be set correctly in initial value: */ 00186 /* (all are constants) */ 00187 char **variable; 00188 const char *boot_val; 00189 GucStringAssignHook assign_hook; 00190 GucShowHook show_hook; 00191 /* variable fields, initialized at runtime: */ 00192 char *reset_val; 00193 char *tentative_val; 00194 }; 00195 00196 /* constant tables corresponding to enums above and in guc.h */ 00197 extern const char *const config_group_names[]; 00198 extern const char *const config_type_names[]; 00199 extern const char *const GucContext_Names[]; 00200 extern const char *const GucSource_Names[]; 00201 00202 /* get the current set of variables */ 00203 extern struct config_generic **get_guc_variables(void); 00204 00205 extern void build_guc_variables(void); 00206 00207 #endif /* GUC_TABLES_H */