mirror of
https://github.com/postgres/postgres.git
synced 2025-11-06 07:49:08 +03:00
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.
This commit is contained in:
@@ -306,9 +306,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 = GetConfigOption(item->name, true, false);
|
||||
|
||||
/* 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 */
|
||||
@@ -323,7 +323,7 @@ ProcessConfigFile(GucContext context)
|
||||
|
||||
if (pre_value)
|
||||
{
|
||||
const char *post_value = GetConfigOption(item->name, false);
|
||||
const char *post_value = GetConfigOption(item->name, true, false);
|
||||
|
||||
if (!post_value)
|
||||
post_value = "";
|
||||
|
||||
Reference in New Issue
Block a user