summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2011-10-04 19:57:21 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2011-10-04 19:57:21 -0400
commit41e461d36fb1ef78494429f28ea4b72c759f419d (patch)
tree42fd260b4b95417a452b4e76ff4831ea44a65b89 /src/include
parentfa56a0c3e01c175695e932e6cdc2c6915df5adc6 (diff)
Improve define_custom_variable's handling of pre-existing settings.
Arrange for any problems with pre-existing settings to be reported as WARNING not ERROR, so that we don't undesirably abort the loading of the incoming add-on module. The bad setting is just discarded, as though it had never been applied at all. (This requires a change in the API of set_config_option. After some thought I decided the most potentially useful addition was to allow callers to just pass in a desired elevel.) Arrange to restore the complete stacked state of the variable, rather than cheesily reinstalling only the active value. This ensures that custom GUCs will behave unsurprisingly even when the module loading operation occurs within nested subtransactions that have changed the active value. Since a module load could occur as a result of, eg, a PL function call, this is not an unlikely scenario.
Diffstat (limited to 'src/include')
-rw-r--r--src/include/utils/guc.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/include/utils/guc.h b/src/include/utils/guc.h
index 450915aaea0..d88a4b6cfd4 100644
--- a/src/include/utils/guc.h
+++ b/src/include/utils/guc.h
@@ -315,7 +315,7 @@ extern bool parse_int(const char *value, int *result, int flags,
extern bool parse_real(const char *value, double *result);
extern int set_config_option(const char *name, const char *value,
GucContext context, GucSource source,
- GucAction action, bool changeVal);
+ GucAction action, bool changeVal, int elevel);
extern char *GetConfigOptionByName(const char *name, const char **varname);
extern void GetConfigOptionByNum(int varnum, const char **values, bool *noshow);
extern int GetNumConfigOptions(void);