From: Peter Eisentraut Date: Thu, 17 Sep 2009 20:54:03 +0000 (+0000) Subject: When reloading postgresql.conf, log what parameters actually changed X-Git-Url: http://git.postgresql.org/gitweb/?a=commitdiff_plain;h=03c08256812b7e1f7ee6bee98eb38442e65d765c;p=users%2Fsimon%2Fpostgres.git When reloading postgresql.conf, log what parameters actually changed --- diff --git a/src/backend/utils/misc/guc-file.l b/src/backend/utils/misc/guc-file.l index 9e9c3f7793..b1ff03666a 100644 --- a/src/backend/utils/misc/guc-file.l +++ b/src/backend/utils/misc/guc-file.l @@ -283,6 +283,10 @@ ProcessConfigFile(GucContext context) /* Now we can re-apply the wired-in default */ set_config_option(gconf->name, NULL, context, PGC_S_DEFAULT, GUC_ACTION_SET, true); + if (context == PGC_SIGHUP) + ereport(elevel, + (errmsg("parameter \"%s\" removed from configuration file, reset to default", + gconf->name))); } /* @@ -309,9 +313,18 @@ ProcessConfigFile(GucContext context) /* If we got here all the options checked out okay, so apply them. */ for (item = head; item; item = item->next) { + char *pre_value = NULL; + + if (context == PGC_SIGHUP) + pre_value = pstrdup(GetConfigOption(item->name)); + if (set_config_option(item->name, item->value, context, PGC_S_FILE, GUC_ACTION_SET, true)) { + if (pre_value && strcmp(pre_value, GetConfigOption(item->name)) != 0) + ereport(elevel, + (errmsg("parameter \"%s\" changed to \"%s\"", + item->name, item->value))); set_config_sourcefile(item->name, item->filename, item->sourceline); }