1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-30 11:03:19 +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

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