diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2004-03-19 02:23:59 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2004-03-19 02:23:59 +0000 |
commit | 74ffc77279d092eb9e31c5e13a015173fca7addb (patch) | |
tree | 815ffe939e868a3182c03c81e9f023af3514ca4c /src/backend/utils/misc/ps_status.c | |
parent | 8726591720df30269488c09ccd6ad8e985c72c06 (diff) | |
download | postgresql-74ffc77279d092eb9e31c5e13a015173fca7addb.tar.gz postgresql-74ffc77279d092eb9e31c5e13a015173fca7addb.zip |
Code review for log_line_prefix patch. Cooperate with StringInfo instead
of fighting it, avoid hard-wired (and wrong) assumption about max length
of prefix, cause %l to actually work as documented, don't compute data
we may not need.
Diffstat (limited to 'src/backend/utils/misc/ps_status.c')
-rw-r--r-- | src/backend/utils/misc/ps_status.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/backend/utils/misc/ps_status.c b/src/backend/utils/misc/ps_status.c index 770882cc8ef..aa3f2fe199c 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.18 2004/03/09 04:43:07 momjian Exp $ + * $PostgreSQL: pgsql/src/backend/utils/misc/ps_status.c,v 1.19 2004/03/19 02:23:59 tgl Exp $ * * Copyright (c) 2000-2003, PostgreSQL Global Development Group * various details abducted from various places @@ -277,15 +277,14 @@ init_ps_display(const char *username, const char *dbname, void set_ps_display(const char *activity) { - /* no ps display for stand-alone backend */ - if (!IsUnderPostmaster) - return; - - /* save it for logging context */ + /* save tag for possible use by elog.c */ if (MyProcPort) - MyProcPort->commandTag = (char *) activity; + MyProcPort->commandTag = activity; #ifndef PS_USE_NONE + /* no ps display for stand-alone backend */ + if (!IsUnderPostmaster) + return; #ifdef PS_USE_CLOBBER_ARGV /* If ps_buffer is a pointer, it might still be null */ |