Commit ad3b40eb authored by Alvaro Herrera's avatar Alvaro Herrera

Set pg_setting.pending_restart when pertinent config lines are removed

This changes the behavior of examining the pg_file_settings view after
changing a config option that requires restart.  The user needs to know
that any change of such options does not take effect until a restart,
and this worked correctly if the line is edited without removing it.
However, for the case where the line is removed altogether, the flag
doesn't get set, because a flag was only set in set_config_option, but
that's not called for lines removed.  Repair.

(Ref.: commits 62d16c7f and a486e357)

Author: Álvaro Herrera <alvherre@alvh.no-ip.org>
Reviewed-by: default avatarDaniel Gustafsson <daniel@yesql.se>
Reviewed-by: default avatarTom Lane <tgl@sss.pgh.pa.us>
Discussion: https://postgr.es/m/202107262302.xsfdfc5sb7sh@alvherre.pgsql
parent b7ea0e8c
...@@ -346,6 +346,8 @@ ProcessConfigFileInternal(GucContext context, bool applySettings, int elevel) ...@@ -346,6 +346,8 @@ ProcessConfigFileInternal(GucContext context, bool applySettings, int elevel)
continue; continue;
if (gconf->context < PGC_SIGHUP) if (gconf->context < PGC_SIGHUP)
{ {
/* The removal can't be effective without a restart */
gconf->status |= GUC_PENDING_RESTART;
ereport(elevel, ereport(elevel,
(errcode(ERRCODE_CANT_CHANGE_RUNTIME_PARAM), (errcode(ERRCODE_CANT_CHANGE_RUNTIME_PARAM),
errmsg("parameter \"%s\" cannot be changed without restarting the server", errmsg("parameter \"%s\" cannot be changed without restarting the server",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment