diff options
| author | Tom Lane <tgl@sss.pgh.pa.us> | 2011-07-08 17:03:12 -0400 |
|---|---|---|
| committer | Tom Lane <tgl@sss.pgh.pa.us> | 2011-07-08 17:03:12 -0400 |
| commit | 9a9e530713d3ccf20a485c8cc61d6d599340d985 (patch) | |
| tree | b9e1d2b2726ba68ecfebb8204ec9f7a7739cd0e1 /src/backend/utils/misc/guc-file.l | |
| parent | d1ca2a1ee93916d69836d7a1924aa7601bcfb635 (diff) | |
Fix another oversight in logging of changes in postgresql.conf settings.
We were using GetConfigOption to collect the old value of each setting,
overlooking the possibility that it didn't exist yet. This does happen
in the case of adding a new entry within a custom variable class, as
exhibited in bug #6097 from Maxim Boguk.
To fix, add a missing_ok parameter to GetConfigOption, but only in 9.1
and HEAD --- it seems possible that some third-party code is using that
function, so changing its API in a minor release would cause problems.
In 9.0, create a near-duplicate function instead.
Diffstat (limited to 'src/backend/utils/misc/guc-file.l')
| -rw-r--r-- | src/backend/utils/misc/guc-file.l | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/backend/utils/misc/guc-file.l b/src/backend/utils/misc/guc-file.l index 3d71a393570..f5a0f87ea1c 100644 --- a/src/backend/utils/misc/guc-file.l +++ b/src/backend/utils/misc/guc-file.l @@ -317,9 +317,9 @@ ProcessConfigFile(GucContext context) /* In SIGHUP cases in the postmaster, report changes */ if (context == PGC_SIGHUP && !IsUnderPostmaster) { - const char *preval = GetConfigOption(item->name, false); + const char *preval = GetConfigOptionNoError(item->name); - /* string variables could be NULL; treat that as empty */ + /* If option doesn't exist yet or is NULL, treat as empty string */ if (!preval) preval = ""; /* must dup, else might have dangling pointer below */ @@ -334,7 +334,7 @@ ProcessConfigFile(GucContext context) if (pre_value) { - const char *post_value = GetConfigOption(item->name, false); + const char *post_value = GetConfigOptionNoError(item->name); if (!post_value) post_value = ""; |
