aboutsummaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2005-11-05 03:04:53 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2005-11-05 03:04:53 +0000
commit48052de722a502408275fa3b7aee7de430265fc0 (patch)
tree88e3bb1280caae1ee6f4e83724a8f3aa65d25353 /src/include
parent95af2633c3e3d64a3cc508409a74ef29de25c852 (diff)
downloadpostgresql-48052de722a502408275fa3b7aee7de430265fc0.tar.gz
postgresql-48052de722a502408275fa3b7aee7de430265fc0.zip
Repair an error introduced by log_line_prefix patch: it is not acceptable
to assume that the string pointer passed to set_ps_display is good forever. There's no need to anyway since ps_status.c itself saves the string, and we already had an API (get_ps_display) to return it. I believe this explains Jim Nasby's report of intermittent crashes in elog.c when %i format code is in use in log_line_prefix. While at it, repair a previously unnoticed problem: on some platforms such as Darwin, the string returned by get_ps_display was blank-padded to the maximum length, meaning that lock.c's attempt to append " waiting" to it never worked.
Diffstat (limited to 'src/include')
-rw-r--r--src/include/libpq/libpq-be.h3
-rw-r--r--src/include/utils/ps_status.h4
2 files changed, 3 insertions, 4 deletions
diff --git a/src/include/libpq/libpq-be.h b/src/include/libpq/libpq-be.h
index 465abdbd38a..8d7f88d1352 100644
--- a/src/include/libpq/libpq-be.h
+++ b/src/include/libpq/libpq-be.h
@@ -11,7 +11,7 @@
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/libpq/libpq-be.h,v 1.52 2005/10/15 02:49:44 momjian Exp $
+ * $PostgreSQL: pgsql/src/include/libpq/libpq-be.h,v 1.53 2005/11/05 03:04:53 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -80,7 +80,6 @@ typedef struct Port
* but since it gets used by elog.c in the same way as database_name and
* other members of this struct, we may as well keep it here.
*/
- const char *commandTag; /* current command tag */
struct timeval session_start; /* for session duration logging */
/*
diff --git a/src/include/utils/ps_status.h b/src/include/utils/ps_status.h
index 6855d34a34f..b940888784b 100644
--- a/src/include/utils/ps_status.h
+++ b/src/include/utils/ps_status.h
@@ -4,7 +4,7 @@
*
* Declarations for backend/utils/misc/ps_status.c
*
- * $PostgreSQL: pgsql/src/include/utils/ps_status.h,v 1.25 2004/02/22 21:26:54 tgl Exp $
+ * $PostgreSQL: pgsql/src/include/utils/ps_status.h,v 1.26 2005/11/05 03:04:53 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -19,6 +19,6 @@ extern void init_ps_display(const char *username, const char *dbname,
extern void set_ps_display(const char *activity);
-extern const char *get_ps_display(void);
+extern const char *get_ps_display(int *displen);
#endif /* PS_STATUS_H */