Add pg_settings.pending_restart column

Started by Peter Eisentrautalmost 11 years ago7 messages
#1Peter Eisentraut
peter_e@gmx.net
1 attachment(s)

When managing configuration changes through automatic systems like Chef
or Puppet, there is a problem: How do you manage changes requiring a
restart?

Generally, you'd set it up so that when a configuration file is changed,
the server is reloaded. But for settings that require a restart, well,
I don't know. From discussions with others, it emerged that a way to
ask the server whether a restart is necessary would be useful. Then you
can either automate the restart, or have a monitoring system warn you
about it, and possibly schedule a restart separately or undo the
configuration file change.

So here is a patch for that. It adds a column pending_restart to
pg_settings that is true when the configuration file contains a changed
setting that requires a restart. We already had the logic to detect
such changes, for producing the log entry. I have also set it up so
that if you change your mind and undo the setting and reload the server,
the pending_restart flag is reset to false.

Attachments:

0001-Add-pg_settings.pending_restart-column.patchtext/x-patch; name=0001-Add-pg_settings.pending_restart-column.patchDownload
>From dd477dba05c5fc3a6e51535bb8280a67d22271f5 Mon Sep 17 00:00:00 2001
From: Peter Eisentraut <peter_e@gmx.net>
Date: Sat, 14 Feb 2015 21:58:59 -0500
Subject: [PATCH] Add pg_settings.pending_restart column

---
 doc/src/sgml/catalogs.sgml          |  6 ++++++
 src/backend/utils/misc/guc.c        | 21 ++++++++++++++++++++-
 src/include/catalog/catversion.h    |  2 +-
 src/include/catalog/pg_proc.h       |  2 +-
 src/include/utils/guc_tables.h      |  1 +
 src/test/regress/expected/rules.out |  5 +++--
 6 files changed, 32 insertions(+), 5 deletions(-)

diff --git a/doc/src/sgml/catalogs.sgml b/doc/src/sgml/catalogs.sgml
index 515a40e..4d1a401 100644
--- a/doc/src/sgml/catalogs.sgml
+++ b/doc/src/sgml/catalogs.sgml
@@ -8841,6 +8841,12 @@ <title><structname>pg_settings</> Columns</title>
       or when examined by a non-superuser)
       </entry>
      </row>
+     <row>
+      <entry><structfield>pending_restart</structfield></entry>
+      <entry><type>boolean</type></entry>
+      <entry>Set to true of the value has been changed in the configuration
+       file but needs a restart.</entry>
+     </row>
     </tbody>
    </tgroup>
   </table>
diff --git a/src/backend/utils/misc/guc.c b/src/backend/utils/misc/guc.c
index 9572777..44a2fc2 100644
--- a/src/backend/utils/misc/guc.c
+++ b/src/backend/utils/misc/guc.c
@@ -5834,12 +5834,15 @@ 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;
 					}
+					else
+						record->status &= ~GUC_PENDING_RESTART;
 					return -1;
 				}
 
@@ -5922,12 +5925,15 @@ 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;
 					}
+					else
+						record->status &= ~GUC_PENDING_RESTART;
 					return -1;
 				}
 
@@ -6010,12 +6016,15 @@ 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;
 					}
+					else
+						record->status &= ~GUC_PENDING_RESTART;
 					return -1;
 				}
 
@@ -6116,12 +6125,15 @@ 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;
 					}
+					else
+						record->status &= ~GUC_PENDING_RESTART;
 					return -1;
 				}
 
@@ -6209,12 +6221,15 @@ 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;
 					}
+					else
+						record->status &= ~GUC_PENDING_RESTART;
 					return -1;
 				}
 
@@ -7907,6 +7922,8 @@ GetConfigOptionByNum(int varnum, const char **values, bool *noshow)
 		values[14] = NULL;
 		values[15] = NULL;
 	}
+
+	values[16] = conf->status & GUC_PENDING_RESTART ? "t" : "f";
 }
 
 /*
@@ -7942,7 +7959,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)
@@ -8002,6 +8019,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
diff --git a/src/include/catalog/catversion.h b/src/include/catalog/catversion.h
index 2b7a0bb..cd89163 100644
--- a/src/include/catalog/catversion.h
+++ b/src/include/catalog/catversion.h
@@ -53,6 +53,6 @@
  */
 
 /*							yyyymmddN */
-#define CATALOG_VERSION_NO	201501281
+#define CATALOG_VERSION_NO	201502135
 
 #endif
diff --git a/src/include/catalog/pg_proc.h b/src/include/catalog/pg_proc.h
index 9edfdb8..04c58c0 100644
--- a/src/include/catalog/pg_proc.h
+++ b/src/include/catalog/pg_proc.h
@@ -3015,7 +3015,7 @@ DATA(insert OID = 2077 (  current_setting	PGNSP PGUID 12 1 0 0 0 f f f f t f s 1
 DESCR("SHOW X as a function");
 DATA(insert OID = 2078 (  set_config		PGNSP PGUID 12 1 0 0 0 f f f f f f v 3 0 25 "25 25 16" _null_ _null_ _null_ _null_ set_config_by_name _null_ _null_ _null_ ));
 DESCR("SET X as a function");
-DATA(insert OID = 2084 (  pg_show_all_settings	PGNSP PGUID 12 1 1000 0 0 f f f f t t s 0 0 2249 "" "{25,25,25,25,25,25,25,25,25,25,25,1009,25,25,25,23}" "{o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o}" "{name,setting,unit,category,short_desc,extra_desc,context,vartype,source,min_val,max_val,enumvals,boot_val,reset_val,sourcefile,sourceline}" _null_ show_all_settings _null_ _null_ _null_ ));
+DATA(insert OID = 2084 (  pg_show_all_settings	PGNSP PGUID 12 1 1000 0 0 f f f f t t s 0 0 2249 "" "{25,25,25,25,25,25,25,25,25,25,25,1009,25,25,25,23,16}" "{o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o}" "{name,setting,unit,category,short_desc,extra_desc,context,vartype,source,min_val,max_val,enumvals,boot_val,reset_val,sourcefile,sourceline,pending_restart}" _null_ show_all_settings _null_ _null_ _null_ ));
 DESCR("SHOW ALL as a function");
 DATA(insert OID = 1371 (  pg_lock_status   PGNSP PGUID 12 1 1000 0 0 f f f f t t v 0 0 2249 "" "{25,26,26,23,21,25,28,26,26,21,25,23,25,16,16}" "{o,o,o,o,o,o,o,o,o,o,o,o,o,o,o}" "{locktype,database,relation,page,tuple,virtualxid,transactionid,classid,objid,objsubid,virtualtransaction,pid,mode,granted,fastpath}" _null_ pg_lock_status _null_ _null_ _null_ ));
 DESCR("view system lock information");
diff --git a/src/include/utils/guc_tables.h b/src/include/utils/guc_tables.h
index cf319af..c0f9cb9 100644
--- a/src/include/utils/guc_tables.h
+++ b/src/include/utils/guc_tables.h
@@ -167,6 +167,7 @@ struct config_generic
  * Caution: the GUC_IS_IN_FILE bit is transient state for ProcessConfigFile.
  * Do not assume that its value represents useful information elsewhere.
  */
+#define GUC_PENDING_RESTART	0x0002
 
 
 /* GUC records for specific variable types */
diff --git a/src/test/regress/expected/rules.out b/src/test/regress/expected/rules.out
index d50b103..de10898 100644
--- a/src/test/regress/expected/rules.out
+++ b/src/test/regress/expected/rules.out
@@ -1601,8 +1601,9 @@ pg_settings| SELECT a.name,
     a.boot_val,
     a.reset_val,
     a.sourcefile,
-    a.sourceline
-   FROM pg_show_all_settings() a(name, setting, unit, category, short_desc, extra_desc, context, vartype, source, min_val, max_val, enumvals, boot_val, reset_val, sourcefile, sourceline);
+    a.sourceline,
+    a.pending_restart
+   FROM pg_show_all_settings() a(name, setting, unit, category, short_desc, extra_desc, context, vartype, source, min_val, max_val, enumvals, boot_val, reset_val, sourcefile, sourceline, pending_restart);
 pg_shadow| SELECT pg_authid.rolname AS usename,
     pg_authid.oid AS usesysid,
     pg_authid.rolcreatedb AS usecreatedb,
-- 
2.3.0

#2David G Johnston
david.g.johnston@gmail.com
In reply to: Peter Eisentraut (#1)
Re: Add pg_settings.pending_restart column

Peter Eisentraut-2 wrote

So here is a patch for that. It adds a column pending_restart to
pg_settings that is true when the configuration file contains a changed
setting that requires a restart. We already had the logic to detect
such changes, for producing the log entry. I have also set it up so
that if you change your mind and undo the setting and reload the server,
the pending_restart flag is reset to false.

Doc typo: s/of/if/

Otherwise it seems fine but I cannot help but feel that false positives are
possible; though nothing that doesn't already exist. Mainly, is the change
going to end up only affect the reset or default value but not the currently
active value?

Instead of a boolean I'd rather have a string/enum that can capture the fact
that a reboot is required and the expected outcome. The same field can then
communicate non-reboot stuff too - like "SIGHUP required" or "session
scope".

A simple reboot required boolean api could just as easily be done via a
function; and why limit to just reboots and not reconnection or SIGHUP
required?

Scope creeping but the reboot case doesn't seem that special overall; other
than the effort needed to realize the updated value.

David J.

--
View this message in context: http://postgresql.nabble.com/Add-pg-settings-pending-restart-column-tp5838009p5838020.html
Sent from the PostgreSQL - hackers mailing list archive at Nabble.com.

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#3Robert Haas
robertmhaas@gmail.com
In reply to: Peter Eisentraut (#1)
Re: Add pg_settings.pending_restart column

On Sat, Feb 14, 2015 at 10:18 PM, Peter Eisentraut <peter_e@gmx.net> wrote:

When managing configuration changes through automatic systems like Chef
or Puppet, there is a problem: How do you manage changes requiring a
restart?

Generally, you'd set it up so that when a configuration file is changed,
the server is reloaded. But for settings that require a restart, well,
I don't know. From discussions with others, it emerged that a way to
ask the server whether a restart is necessary would be useful. Then you
can either automate the restart, or have a monitoring system warn you
about it, and possibly schedule a restart separately or undo the
configuration file change.

So here is a patch for that. It adds a column pending_restart to
pg_settings that is true when the configuration file contains a changed
setting that requires a restart. We already had the logic to detect
such changes, for producing the log entry. I have also set it up so
that if you change your mind and undo the setting and reload the server,
the pending_restart flag is reset to false.

You don't really need the "else" here, and in parallel cases:

                     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;
                     }
+                    else
+                        record->status &= ~GUC_PENDING_RESTART;
                     return -1;

The if-statement ends with "return 0" so there is no reason for the "else".

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#4Peter Eisentraut
peter_e@gmx.net
In reply to: Robert Haas (#3)
Re: Add pg_settings.pending_restart column

On 2/17/15 10:45 AM, Robert Haas wrote:

You don't really need the "else" here, and in parallel cases:

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;
}
+                    else
+                        record->status &= ~GUC_PENDING_RESTART;
return -1;

The if-statement ends with "return 0" so there is no reason for the "else".

I kind of liked the symmetry of if/else, but I can change it.

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#5Peter Eisentraut
peter_e@gmx.net
In reply to: David G Johnston (#2)
Re: Add pg_settings.pending_restart column

On 2/15/15 3:41 AM, David G Johnston wrote:

Otherwise it seems fine but I cannot help but feel that false positives are
possible; though nothing that doesn't already exist. Mainly, is the change
going to end up only affect the reset or default value but not the currently
active value?

I don't understand what you mean by this. We already have the logic to
detect the situation concerned. I'm only extending the reporting. Of
course, if you can think of a case where it doesn't work correctly,
let's hear it.

Instead of a boolean I'd rather have a string/enum that can capture the fact
that a reboot is required and the expected outcome. The same field can then
communicate non-reboot stuff too - like "SIGHUP required" or "session
scope".

A simple reboot required boolean api could just as easily be done via a
function; and why limit to just reboots and not reconnection or SIGHUP
required?

Scope creeping but the reboot case doesn't seem that special overall; other
than the effort needed to realize the updated value.

It is special because we apply the context restrictions differently in
this case. Normally, when you try to set a parameter that you can't
set, you get an error. But in the case of restart-only, we just ignore
it (and log a message). The point here is to make that more easily
detectable.

What you describe sounds more like that you want to see the complete
stack of overridden and possibly overriding settings. That's a bit of a
different feature, I think.

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#6Michael Paquier
michael.paquier@gmail.com
In reply to: Peter Eisentraut (#4)
1 attachment(s)
Re: Add pg_settings.pending_restart column

On Thu, Mar 5, 2015 at 12:04 PM, Peter Eisentraut <peter_e@gmx.net> wrote:

On 2/17/15 10:45 AM, Robert Haas wrote:

You don't really need the "else" here, and in parallel cases:

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;
}
+                    else
+                        record->status &= ~GUC_PENDING_RESTART;
return -1;

The if-statement ends with "return 0" so there is no reason for the "else".

I kind of liked the symmetry of if/else, but I can change it.

This feature looks useful to me. I had a quick look and it is working
as intended: issuing SIGHUP to reload parameters updates the
pending_restart status correctly.

One additional comment on top of what has already been mentioned is
that this lacks parenthesis IMO:
-     values[16] = conf->status & GUC_PENDING_RESTART ? "t" : "f";
+     values[16] = (conf->status & GUC_PENDING_RESTART) ? "t" : "f";
Also, documentation was not correctly formatted.

Changes with ALTER SYSTEM (and include files) get recognized as well.
For example:
=# \! echo max_prepared_transactions = 100 >> $PGDATA/postgresql.conf
=# select pg_reload_conf();
pg_reload_conf
----------------
t
(1 row)
=# select name from pg_settings where pending_restart;
name
---------------------------
max_prepared_transactions
(1 row)
=# alter system set max_connections = 1000;
ALTER SYSTEM
=# select pg_reload_conf();
pg_reload_conf
----------------
t
(1 row)
=# select name from pg_settings where pending_restart;
name
---------------------------
max_connections
max_prepared_transactions
(2 rows)

Attached is a rebased patch with previous comments addressed as I was
looking at it.
Switching this patch as "Ready for committer".
Regards,
--
Michael

Attachments:

20150422_pending_restart_v2.patchapplication/x-patch; name=20150422_pending_restart_v2.patchDownload
diff --git a/doc/src/sgml/catalogs.sgml b/doc/src/sgml/catalogs.sgml
index d0b78f2..53d3f4f 100644
--- a/doc/src/sgml/catalogs.sgml
+++ b/doc/src/sgml/catalogs.sgml
@@ -8822,6 +8822,14 @@ SELECT * FROM pg_locks pl LEFT JOIN pg_prepared_xacts ppx
       or when examined by a non-superuser)
       </entry>
      </row>
+     <row>
+      <entry><structfield>pending_restart</structfield></entry>
+      <entry><type>boolean</type></entry>
+      <entry><literal>true</literal> if the value has been changed in the
+      configuration file but needs a restart; or <literal>false</literal>
+      otherwise.
+      </entry>
+     </row>
     </tbody>
    </tgroup>
   </table>
diff --git a/src/backend/utils/misc/guc.c b/src/backend/utils/misc/guc.c
index f43aff2..e09b021 100644
--- a/src/backend/utils/misc/guc.c
+++ b/src/backend/utils/misc/guc.c
@@ -5897,12 +5897,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;
 				}
 
@@ -5985,12 +5987,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;
 				}
 
@@ -6073,12 +6077,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;
 				}
 
@@ -6179,12 +6185,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;
 				}
 
@@ -6272,12 +6280,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;
 				}
 
@@ -7970,6 +7980,8 @@ GetConfigOptionByNum(int varnum, const char **values, bool *noshow)
 		values[14] = NULL;
 		values[15] = NULL;
 	}
+
+	values[16] = (conf->status & GUC_PENDING_RESTART) ? "t" : "f";
 }
 
 /*
@@ -8005,7 +8017,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)
@@ -8065,6 +8077,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
diff --git a/src/include/catalog/pg_proc.h b/src/include/catalog/pg_proc.h
index 619d996..46879b3 100644
--- a/src/include/catalog/pg_proc.h
+++ b/src/include/catalog/pg_proc.h
@@ -3048,7 +3048,7 @@ DATA(insert OID = 2077 (  current_setting	PGNSP PGUID 12 1 0 0 0 f f f f t f s 1
 DESCR("SHOW X as a function");
 DATA(insert OID = 2078 (  set_config		PGNSP PGUID 12 1 0 0 0 f f f f f f v 3 0 25 "25 25 16" _null_ _null_ _null_ _null_ set_config_by_name _null_ _null_ _null_ ));
 DESCR("SET X as a function");
-DATA(insert OID = 2084 (  pg_show_all_settings	PGNSP PGUID 12 1 1000 0 0 f f f f t t s 0 0 2249 "" "{25,25,25,25,25,25,25,25,25,25,25,1009,25,25,25,23}" "{o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o}" "{name,setting,unit,category,short_desc,extra_desc,context,vartype,source,min_val,max_val,enumvals,boot_val,reset_val,sourcefile,sourceline}" _null_ show_all_settings _null_ _null_ _null_ ));
+DATA(insert OID = 2084 (  pg_show_all_settings	PGNSP PGUID 12 1 1000 0 0 f f f f t t s 0 0 2249 "" "{25,25,25,25,25,25,25,25,25,25,25,1009,25,25,25,23,16}" "{o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o}" "{name,setting,unit,category,short_desc,extra_desc,context,vartype,source,min_val,max_val,enumvals,boot_val,reset_val,sourcefile,sourceline,pending_restart}" _null_ show_all_settings _null_ _null_ _null_ ));
 DESCR("SHOW ALL as a function");
 DATA(insert OID = 1371 (  pg_lock_status   PGNSP PGUID 12 1 1000 0 0 f f f f t t v 0 0 2249 "" "{25,26,26,23,21,25,28,26,26,21,25,23,25,16,16}" "{o,o,o,o,o,o,o,o,o,o,o,o,o,o,o}" "{locktype,database,relation,page,tuple,virtualxid,transactionid,classid,objid,objsubid,virtualtransaction,pid,mode,granted,fastpath}" _null_ pg_lock_status _null_ _null_ _null_ ));
 DESCR("view system lock information");
diff --git a/src/include/utils/guc_tables.h b/src/include/utils/guc_tables.h
index cf319af..c0f9cb9 100644
--- a/src/include/utils/guc_tables.h
+++ b/src/include/utils/guc_tables.h
@@ -167,6 +167,7 @@ struct config_generic
  * Caution: the GUC_IS_IN_FILE bit is transient state for ProcessConfigFile.
  * Do not assume that its value represents useful information elsewhere.
  */
+#define GUC_PENDING_RESTART	0x0002
 
 
 /* GUC records for specific variable types */
diff --git a/src/test/regress/expected/rules.out b/src/test/regress/expected/rules.out
index 71fa44a..8590834 100644
--- a/src/test/regress/expected/rules.out
+++ b/src/test/regress/expected/rules.out
@@ -1600,8 +1600,9 @@ pg_settings| SELECT a.name,
     a.boot_val,
     a.reset_val,
     a.sourcefile,
-    a.sourceline
-   FROM pg_show_all_settings() a(name, setting, unit, category, short_desc, extra_desc, context, vartype, source, min_val, max_val, enumvals, boot_val, reset_val, sourcefile, sourceline);
+    a.sourceline,
+    a.pending_restart
+   FROM pg_show_all_settings() a(name, setting, unit, category, short_desc, extra_desc, context, vartype, source, min_val, max_val, enumvals, boot_val, reset_val, sourcefile, sourceline, pending_restart);
 pg_shadow| SELECT pg_authid.rolname AS usename,
     pg_authid.oid AS usesysid,
     pg_authid.rolcreatedb AS usecreatedb,
#7Peter Eisentraut
peter_e@gmx.net
In reply to: Michael Paquier (#6)
Re: Add pg_settings.pending_restart column

On 4/22/15 2:32 AM, Michael Paquier wrote:

Attached is a rebased patch with previous comments addressed as I was
looking at it.
Switching this patch as "Ready for committer".

Committed, thanks.

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers