/* *Stackentryforsavingthestateavariablehadpriortoanuncommitted *transactionalchange
*/ typedefenum
{ /* This is almost GucAction, but we need a fourth state for SET+LOCAL */
GUC_SAVE, /* entry caused by function SET option */
GUC_SET, /* entry caused by plain SET command */
GUC_LOCAL, /* entry caused by SET LOCAL command */
GUC_SET_LOCAL, /* entry caused by SET then SET LOCAL */
} GucStackState;
typedefstruct guc_stack
{ struct guc_stack *prev; /* previous stack item, if any */ int nest_level; /* nesting depth at which we made entry */
GucStackState state; /* see enum above */
GucSource source; /* source of the prior value */ /* masked value's source must be PGC_S_SESSION, so no need to store it */
GucContext scontext; /* context that set the prior value */
GucContext masked_scontext; /* context that set the masked value */
Oid srole; /* role that set the prior value */
Oid masked_srole; /* role that set the masked value */
config_var_value prior; /* previous value of variable */
config_var_value masked; /* SET value in a GUC_SET_LOCAL entry */
} GucStack;
/* *Genericfieldsapplicabletoalltypesofvariables * *Theshortdescriptionshouldbelessthan80charsinlength.Some *applicationsmayusethelongdescriptionaswell,andwillappend *ittotheshortdescription.(separatedbyanewlineor'.') * *IftheGUCacceptsaspecialvaluelike-1todisablethefeature,usea *systemdefault,etc.,itshouldbementionedinthelongdescriptionwith *thefollowingstyle: * *-Specialvaluesshouldbelistedattheendofthelongdescription. *-Descriptionsshouldusenumerals(e.g.,"0")insteadofwords(e.g., *"zero"). *-Specialvaluementionsshouldbeconciseanddirect(e.g.,"0disables *thetimeout.","Anemptystringmeansusetheoperatingsystem *setting."). *-Multiplespecialvaluesshouldbelistedinascendingorder. * *Asanexception,specialvaluesshould_not_bementionedifthedescription *wouldbetoocomplexorifthemeaningissufficientlyobvious. * *sroleistherolethatsetthecurrentvalue,orBOOTSTRAP_SUPERUSERID *ifthevaluecamefromaninternalsourceortheconfigfile.Similarly *forreset_srole(whichisusuallyBOOTSTRAP_SUPERUSERID,butnotalways). * *Variablesthatarecurrentlyofactiveinterestformaintenance *operationsarelinkedintovariouslistsusingthexxx_linkfields. *Thelinkfieldsareunused/garbageinvariablesnotcurrentlyhaving *thespecifiedproperties. * *Notethatsourcefile/sourcelinearekepthere,andnotpushedintostacked *values,althoughinprincipletheybelongwithsomestackedvalueifthe *activevalueissession-ortransaction-local.Thisistoavoidbloating *stackentries.Weknowtheyareonlyrelevantwhensource==PGC_S_FILE.
*/ struct config_generic
{ /* constant fields, must be set correctly in initial value: */ constchar *name; /* name of variable - MUST BE FIRST */
GucContext context; /* context required to set the variable */ enum config_group group; /* to help organize variables by function */ constchar *short_desc; /* short desc. of this variable's purpose */ constchar *long_desc; /* long desc. of this variable's purpose */ int flags; /* flag bits, see guc.h */ /* variable fields, initialized at runtime: */ enum config_type vartype; /* type of variable (set only at startup) */ int status; /* status bits, see below */
GucSource source; /* source of the current actual value */
GucSource reset_source; /* source of the reset_value */
GucContext scontext; /* context that set the current value */
GucContext reset_scontext; /* context that set the reset value */
Oid srole; /* role that set the current value */
Oid reset_srole; /* role that set the reset value */
GucStack *stack; /* stacked prior values */ void *extra; /* "extra" pointer for current actual value */
dlist_node nondef_link; /* list link for variables that have source
* different from PGC_S_DEFAULT */
slist_node stack_link; /* list link for variables that have non-NULL
* stack */
slist_node report_link; /* list link for variables that have the
* GUC_NEEDS_REPORT bit set in status */ char *last_reported; /* if variable is GUC_REPORT, value last sent
* to client (NULL if not yet sent) */ char *sourcefile; /* file current setting is from (NULL if not
* set in config file) */ int sourceline; /* line in source file */
};
/* bit values in status field */ #define GUC_IS_IN_FILE 0x0001 /* found it in config file */ /* *Caution:theGUC_IS_IN_FILEbitistransientstateforProcessConfigFile. *Donotassumethatitsvaluerepresentsusefulinformationelsewhere.
*/ #define GUC_PENDING_RESTART 0x0002 /* changed value cannot be applied yet */ #define GUC_NEEDS_REPORT 0x0004 /* new value must be reported to client */
/* GUC records for specific variable types */
struct config_bool
{ struct config_generic gen; /* constant fields, must be set correctly in initial value: */ bool *variable; bool boot_val;
GucBoolCheckHook check_hook;
GucBoolAssignHook assign_hook;
GucShowHook show_hook; /* variable fields, initialized at runtime: */ bool reset_val; void *reset_extra;
};
struct config_int
{ struct config_generic gen; /* constant fields, must be set correctly in initial value: */ int *variable; int boot_val; int min; int max;
GucIntCheckHook check_hook;
GucIntAssignHook assign_hook;
GucShowHook show_hook; /* variable fields, initialized at runtime: */ int reset_val; void *reset_extra;
};
struct config_real
{ struct config_generic gen; /* constant fields, must be set correctly in initial value: */ double *variable; double boot_val; double min; double max;
GucRealCheckHook check_hook;
GucRealAssignHook assign_hook;
GucShowHook show_hook; /* variable fields, initialized at runtime: */ double reset_val; void *reset_extra;
};
/* *AnoteaboutstringGUCs:theboot_valisallowedtobeNULL,whichleads *tothereset_valandtheactualvariablevalue(*variable)alsobeingNULL. *However,thereisnowaytosetaNULLvaluesubsequentlyusing *set_config_optionoranyotherGUCAPI.Also,GUCAPIssuchasSHOWwill *displayaNULLvalueasanemptystring.CallersthatchoosetouseaNULL *boot_valshouldoverwritethesettinglaterinstartup,orelsebecareful *thatNULLdoesn'thavesemanticsthatarevisiblydifferentfromanempty *string.
*/ struct config_string
{ struct config_generic gen; /* constant fields, must be set correctly in initial value: */ char **variable; constchar *boot_val;
GucStringCheckHook check_hook;
GucStringAssignHook assign_hook;
GucShowHook show_hook; /* variable fields, initialized at runtime: */ char *reset_val; void *reset_extra;
};
struct config_enum
{ struct config_generic gen; /* constant fields, must be set correctly in initial value: */ int *variable; int boot_val; conststruct config_enum_entry *options;
GucEnumCheckHook check_hook;
GucEnumAssignHook assign_hook;
GucShowHook show_hook; /* variable fields, initialized at runtime: */ int reset_val; void *reset_extra;
};
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.