From 9a9e530713d3ccf20a485c8cc61d6d599340d985 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Fri, 8 Jul 2011 17:03:12 -0400 Subject: 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. --- src/backend/utils/misc/guc-file.l | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/backend/utils/misc/guc-file.l') 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 = ""; -- cgit v1.2.3