1
0
mirror of https://github.com/postgres/postgres.git synced 2025-09-03 15:22:11 +03:00

Add GUC update_process_title to control whether 'ps' display is updated

for every command, default to on.
This commit is contained in:
Bruce Momjian
2006-06-27 22:16:44 +00:00
parent 69d0a15e2a
commit 370a709c75
14 changed files with 89 additions and 52 deletions

View File

@@ -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"
@@ -728,6 +729,16 @@ static struct config_bool ConfigureNamesBool[] =
true, NULL, NULL
},
{
{"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."),

View File

@@ -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

View File

@@ -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)