]> granicus.if.org Git - postgresql/commitdiff
Disable update_process_title by default on Windows
authorMagnus Hagander <magnus@hagander.net>
Wed, 17 Aug 2016 08:39:22 +0000 (10:39 +0200)
committerMagnus Hagander <magnus@hagander.net>
Wed, 17 Aug 2016 08:43:55 +0000 (10:43 +0200)
The performance overhead of this can be significant on Windows, and most
people don't have the tools to view it anyway as Windows does not have
native support for process titles.

Discussion: <0A3221C70F24FB45833433255569204D1F5BE3E8@G01JPEXMBYT05>

Takayuki Tsunakawa

doc/src/sgml/config.sgml
src/backend/utils/misc/guc.c
src/bin/initdb/initdb.c

index 27176aa07c40c7764e34cb3520b95f25c0c48a10..0b14e60156ed1aaa1244c90ddac9d61eeb338bc9 100644 (file)
@@ -5430,6 +5430,8 @@ COPY postgres_log FROM '/full/path/to/logfile.csv' WITH csv;
         is received by the server.  The process title is typically viewed
         by the <command>ps</> command,
         or in Windows by using the <application>Process Explorer</>.
+        This value defaults to off on Windows platforms due to the
+        platform's significant overhead for updating the process title.
         Only superusers can change this setting.
        </para>
       </listitem>
index 0a58ba1faeb0b6f3694c023e7e88829241549f3d..31172ef3007476ba60ca27c2e5d97252ee4fa908 100644 (file)
@@ -1210,7 +1210,11 @@ static struct config_bool ConfigureNamesBool[] =
                        gettext_noop("Enables updating of the process title every time a new SQL command is received by the server.")
                },
                &update_process_title,
+#ifdef WIN32
+               false,
+#else
                true,
+#endif
                NULL, NULL, NULL
        },
 
index 73cb7ee683d8d8f7a4d71ca01ae04b9f97499cf9..a978bbc328ae8695e5666dcf049e337c61ff7924 100644 (file)
@@ -1292,6 +1292,12 @@ setup_config(void)
                                                          "#effective_io_concurrency = 0");
 #endif
 
+#ifdef WIN32
+       conflines = replace_token(conflines,
+                                                         "#update_process_title = on",
+                                                         "#update_process_title = off");
+#endif
+
        snprintf(path, sizeof(path), "%s/postgresql.conf", pg_data);
 
        writefile(path, conflines);