1
0
mirror of https://github.com/postgres/postgres.git synced 2025-08-27 07:42:10 +03:00

Add pg_settings.pending_restart column

with input from David G. Johnston, Robert Haas, Michael Paquier
This commit is contained in:
Peter Eisentraut
2015-05-14 20:08:51 -04:00
parent 333a870f94
commit a486e35706
6 changed files with 29 additions and 5 deletions

View File

@@ -5927,12 +5927,14 @@ set_config_option(const char *name, const char *value,
{
if (*conf->variable != newval)
{
record->status |= GUC_PENDING_RESTART;
ereport(elevel,
(errcode(ERRCODE_CANT_CHANGE_RUNTIME_PARAM),
errmsg("parameter \"%s\" cannot be changed without restarting the server",
name)));
return 0;
}
record->status &= ~GUC_PENDING_RESTART;
return -1;
}
@@ -6015,12 +6017,14 @@ set_config_option(const char *name, const char *value,
{
if (*conf->variable != newval)
{
record->status |= GUC_PENDING_RESTART;
ereport(elevel,
(errcode(ERRCODE_CANT_CHANGE_RUNTIME_PARAM),
errmsg("parameter \"%s\" cannot be changed without restarting the server",
name)));
return 0;
}
record->status &= ~GUC_PENDING_RESTART;
return -1;
}
@@ -6103,12 +6107,14 @@ set_config_option(const char *name, const char *value,
{
if (*conf->variable != newval)
{
record->status |= GUC_PENDING_RESTART;
ereport(elevel,
(errcode(ERRCODE_CANT_CHANGE_RUNTIME_PARAM),
errmsg("parameter \"%s\" cannot be changed without restarting the server",
name)));
return 0;
}
record->status &= ~GUC_PENDING_RESTART;
return -1;
}
@@ -6209,12 +6215,14 @@ set_config_option(const char *name, const char *value,
if (*conf->variable == NULL || newval == NULL ||
strcmp(*conf->variable, newval) != 0)
{
record->status |= GUC_PENDING_RESTART;
ereport(elevel,
(errcode(ERRCODE_CANT_CHANGE_RUNTIME_PARAM),
errmsg("parameter \"%s\" cannot be changed without restarting the server",
name)));
return 0;
}
record->status &= ~GUC_PENDING_RESTART;
return -1;
}
@@ -6302,12 +6310,14 @@ set_config_option(const char *name, const char *value,
{
if (*conf->variable != newval)
{
record->status |= GUC_PENDING_RESTART;
ereport(elevel,
(errcode(ERRCODE_CANT_CHANGE_RUNTIME_PARAM),
errmsg("parameter \"%s\" cannot be changed without restarting the server",
name)));
return 0;
}
record->status &= ~GUC_PENDING_RESTART;
return -1;
}
@@ -8009,6 +8019,8 @@ GetConfigOptionByNum(int varnum, const char **values, bool *noshow)
values[14] = NULL;
values[15] = NULL;
}
values[16] = (conf->status & GUC_PENDING_RESTART) ? "t" : "f";
}
/*
@@ -8044,7 +8056,7 @@ show_config_by_name(PG_FUNCTION_ARGS)
* show_all_settings - equiv to SHOW ALL command but implemented as
* a Table Function.
*/
#define NUM_PG_SETTINGS_ATTS 16
#define NUM_PG_SETTINGS_ATTS 17
Datum
show_all_settings(PG_FUNCTION_ARGS)
@@ -8104,6 +8116,8 @@ show_all_settings(PG_FUNCTION_ARGS)
TEXTOID, -1, 0);
TupleDescInitEntry(tupdesc, (AttrNumber) 16, "sourceline",
INT4OID, -1, 0);
TupleDescInitEntry(tupdesc, (AttrNumber) 17, "pending_restart",
BOOLOID, -1, 0);
/*
* Generate attribute metadata needed later to produce tuples from raw