diff options
Diffstat (limited to 'src/backend/utils/misc')
-rw-r--r-- | src/backend/utils/misc/guc.c | 13 | ||||
-rw-r--r-- | src/backend/utils/misc/postgresql.conf.sample | 3 | ||||
-rw-r--r-- | src/backend/utils/misc/ps_status.c | 12 |
3 files changed, 24 insertions, 4 deletions
diff --git a/src/backend/utils/misc/guc.c b/src/backend/utils/misc/guc.c index 72041bbef7e..9863696e1fb 100644 --- a/src/backend/utils/misc/guc.c +++ b/src/backend/utils/misc/guc.c @@ -10,7 +10,7 @@ * Written by Peter Eisentraut <peter_e@gmx.net>. * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.323 2006/06/27 19:07:50 momjian Exp $ + * $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.324 2006/06/27 22:16:44 momjian Exp $ * *-------------------------------------------------------------------- */ @@ -64,6 +64,7 @@ #include "utils/builtins.h" #include "utils/memutils.h" #include "utils/pg_locale.h" +#include "utils/ps_status.h" #include "pgstat.h" #include "access/gin.h" @@ -729,6 +730,16 @@ static struct config_bool ConfigureNamesBool[] = }, { + {"update_process_title", PGC_SUSET, STATS_COLLECTOR, + 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.") + }, + &update_process_title, + true, NULL, NULL + }, + + { {"autovacuum", PGC_SIGHUP, AUTOVACUUM, gettext_noop("Starts the autovacuum subprocess."), NULL diff --git a/src/backend/utils/misc/postgresql.conf.sample b/src/backend/utils/misc/postgresql.conf.sample index 88d872fbec2..565d8b277be 100644 --- a/src/backend/utils/misc/postgresql.conf.sample +++ b/src/backend/utils/misc/postgresql.conf.sample @@ -323,11 +323,14 @@ # - Query/Index Statistics Collector - #stats_command_string = on +#update_process_title = on + #stats_start_collector = on # needed for block or row stats #stats_block_level = off #stats_row_level = off #stats_reset_on_server_start = off + # - Statistics Monitoring - #log_parser_stats = off diff --git a/src/backend/utils/misc/ps_status.c b/src/backend/utils/misc/ps_status.c index bd8f1d21a1d..d23aa563f79 100644 --- a/src/backend/utils/misc/ps_status.c +++ b/src/backend/utils/misc/ps_status.c @@ -5,7 +5,7 @@ * to contain some useful information. Mechanism differs wildly across * platforms. * - * $PostgreSQL: pgsql/src/backend/utils/misc/ps_status.c,v 1.30 2006/06/12 02:39:49 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/utils/misc/ps_status.c,v 1.31 2006/06/27 22:16:44 momjian Exp $ * * Copyright (c) 2000-2006, PostgreSQL Global Development Group * various details abducted from various places @@ -31,6 +31,7 @@ #include "utils/ps_status.h" extern char **environ; +bool update_process_title = true; /* @@ -210,7 +211,7 @@ save_ps_display_args(int argc, char **argv) */ void init_ps_display(const char *username, const char *dbname, - const char *host_info) + const char *host_info, const char *initial_str) { Assert(username); Assert(dbname); @@ -270,6 +271,7 @@ init_ps_display(const char *username, const char *dbname, ps_buffer_fixed_size = strlen(ps_buffer); + set_ps_display(initial_str, true); #endif /* not PS_USE_NONE */ } @@ -280,8 +282,12 @@ init_ps_display(const char *username, const char *dbname, * indication of what you're currently doing passed in the argument. */ void -set_ps_display(const char *activity) +set_ps_display(const char *activity, bool force) { + + if (!force && !update_process_title) + return; + #ifndef PS_USE_NONE /* no ps display for stand-alone backend */ if (!IsUnderPostmaster) |