Re: [HACKERS] cluster_name and update_process_title documentation

2015-09-25 Thread Tom Lane
Peter Eisentraut  writes:
> The related settings cluster_name and update_process_title have somehow
> ended up at opposite corners of the documentation and sample files.  I
> propose to group them together in a new "Process Title" section, as in
> the attached patch.

I think you missed some places that need to be updated to add a new
config_group value; at least guc.c's config_group_names[] array, and
there might be other places.  But +1 for the concept.

(I wonder if we couldn't add a static assert to catch this class of
error in the future.)

regards, tom lane


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


[HACKERS] cluster_name and update_process_title documentation

2015-09-25 Thread Peter Eisentraut
The related settings cluster_name and update_process_title have somehow
ended up at opposite corners of the documentation and sample files.  I
propose to group them together in a new "Process Title" section, as in
the attached patch.
From 159e0db4d7da647ca6d9153250c60a744517ab3e Mon Sep 17 00:00:00 2001
From: Peter Eisentraut 
Date: Fri, 25 Sep 2015 09:14:50 -0400
Subject: [PATCH] Group cluster_name and update_process_title settings together

---
 doc/src/sgml/config.sgml  | 97 +++
 src/backend/utils/misc/guc.c  |  4 +-
 src/backend/utils/misc/postgresql.conf.sample |  6 +-
 src/include/utils/guc_tables.h|  1 +
 4 files changed, 62 insertions(+), 46 deletions(-)

diff --git a/doc/src/sgml/config.sgml b/doc/src/sgml/config.sgml
index c8ec219..593b8fd 100644
--- a/doc/src/sgml/config.sgml
+++ b/doc/src/sgml/config.sgml
@@ -4345,30 +4345,6 @@ What To Log
   
  
 
- 
-  cluster_name (string)
-  
-   cluster_name configuration parameter
-  
-  
-  
-   
-Sets the cluster name that appears in the process title for all
-processes in this cluster. The name can be any string of less than
-NAMEDATALEN characters (64 characters in a standard
-build). Only printable ASCII characters may be used in the
-cluster_name value. Other characters will be
-replaced with question marks (?).  No name is shown
-if this parameter is set to the empty string '' (which is
-the default). This parameter can only be set at server start.
-   
-   
-The process title is typically viewed using programs like
-ps or, on Windows, Process Explorer.
-   
-  
- 
-
  
   debug_print_parse (boolean)
   
@@ -4956,9 +4932,61 @@ Using CSV-Format Log Output
 
 
   
-
 
-   
+
+   
+Process Title
+
+
+ These settings control how the process title as seen
+ by ps is modified.  See 
+ for details.
+
+
+
+ 
+  cluster_name (string)
+  
+   cluster_name configuration parameter
+  
+  
+  
+   
+Sets the cluster name that appears in the process title for all
+processes in this cluster. The name can be any string of less than
+NAMEDATALEN characters (64 characters in a standard
+build). Only printable ASCII characters may be used in the
+cluster_name value. Other characters will be
+replaced with question marks (?).  No name is shown
+if this parameter is set to the empty string '' (which is
+the default). This parameter can only be set at server start.
+   
+   
+The process title is typically viewed using programs like
+ps or, on Windows, Process Explorer.
+   
+  
+ 
+
+ 
+  update_process_title (boolean)
+  
+   update_process_title configuration parameter
+  
+  
+  
+   
+Enables updating of the process title every time a new SQL command
+is received by the server.  The process title is typically viewed
+by the ps command,
+or in Windows by using the Process Explorer.
+Only superusers can change this setting.
+   
+  
+ 
+
+   
+  
 

 Run-time Statistics
@@ -5076,23 +5104,6 @@ Query and Index Statistics Collector
   
  
 
- 
-  update_process_title (boolean)
-  
-   update_process_title configuration parameter
-  
-  
-  
-   
-Enables updating of the process title every time a new SQL command
-is received by the server.  The process title is typically viewed
-by the ps command,
-or in Windows by using the Process Explorer.
-Only superusers can change this setting.
-   
-  
- 
-
  
   stats_temp_directory (string)
   
diff --git a/src/backend/utils/misc/guc.c b/src/backend/utils/misc/guc.c
index 3d0eb2d..b0554fb 100644
--- a/src/backend/utils/misc/guc.c
+++ b/src/backend/utils/misc/guc.c
@@ -1181,7 +1181,7 @@ static struct config_bool ConfigureNamesBool[] =
 	},
 
 	{
-		{"update_process_title", PGC_SUSET, STATS_COLLECTOR,
+		{"update_process_title", PGC_SUSET, PROCESS_TITLE,
 			gettext_noop("Updates the process title to show the active SQL command."),
 			gettext_noop("Enables updating of the process title every time a new SQL command is received by the server.")
 		},
@@ -3366,7 +3366,7 @@ static struct config_string ConfigureNamesString[] =
 	},
 
 	{
-		{"cluster_name", PGC_POSTMASTER, LOGGING_WHAT,
+		{"cluster_name", PGC_POSTMASTER, PROCESS_TITLE,
 			gettext_noop("Sets the name of the cluster which is included in the process title."),
 			NULL,
 			GUC_IS_NAME
diff --git a/src/backend/utils/misc/postgresql.conf.sample b/src/backend/utils/misc/postgresql.conf.sample
index 412e5c2..18c433b 100644
---