mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-12-21 08:29:39 +08:00
When reloading postgresql.conf, log what parameters actually changed
This commit is contained in:
parent
488d70ab46
commit
44608aee04
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* Copyright (c) 2000-2009, PostgreSQL Global Development Group
|
* Copyright (c) 2000-2009, PostgreSQL Global Development Group
|
||||||
*
|
*
|
||||||
* $PostgreSQL: pgsql/src/backend/utils/misc/guc-file.l,v 1.59 2009/04/09 14:21:02 tgl Exp $
|
* $PostgreSQL: pgsql/src/backend/utils/misc/guc-file.l,v 1.60 2009/09/17 20:54:03 petere Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
%{
|
%{
|
||||||
@ -283,6 +283,10 @@ ProcessConfigFile(GucContext context)
|
|||||||
/* Now we can re-apply the wired-in default */
|
/* Now we can re-apply the wired-in default */
|
||||||
set_config_option(gconf->name, NULL, context, PGC_S_DEFAULT,
|
set_config_option(gconf->name, NULL, context, PGC_S_DEFAULT,
|
||||||
GUC_ACTION_SET, true);
|
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. */
|
/* If we got here all the options checked out okay, so apply them. */
|
||||||
for (item = head; item; item = item->next)
|
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,
|
if (set_config_option(item->name, item->value, context,
|
||||||
PGC_S_FILE, GUC_ACTION_SET, true))
|
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,
|
set_config_sourcefile(item->name, item->filename,
|
||||||
item->sourceline);
|
item->sourceline);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user