summaryrefslogtreecommitdiff
path: root/src/backend/postmaster/pgstat.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/postmaster/pgstat.c')
-rw-r--r--src/backend/postmaster/pgstat.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/backend/postmaster/pgstat.c b/src/backend/postmaster/pgstat.c
index c40b90b5993..c10850a7c1f 100644
--- a/src/backend/postmaster/pgstat.c
+++ b/src/backend/postmaster/pgstat.c
@@ -13,7 +13,7 @@
*
* Copyright (c) 2001-2006, PostgreSQL Global Development Group
*
- * $PostgreSQL: pgsql/src/backend/postmaster/pgstat.c,v 1.124 2006/04/27 00:06:58 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/postmaster/pgstat.c,v 1.125 2006/05/19 15:15:37 alvherre Exp $
* ----------
*/
#include "postgres.h"
@@ -700,17 +700,17 @@ pgstat_bestart(void)
/*
* We may not have a MyProcPort (eg, if this is the autovacuum process).
- * For the moment, punt and don't send BESTART --- would be better to work
- * out a clean way of handling "unknown clientaddr".
+ * Send an all-zeroes client address, which is dealt with specially in
+ * pg_stat_get_backend_client_addr and pg_stat_get_backend_client_port.
*/
+ pgstat_setheader(&msg.m_hdr, PGSTAT_MTYPE_BESTART);
+ msg.m_databaseid = MyDatabaseId;
+ msg.m_userid = GetSessionUserId();
if (MyProcPort)
- {
- pgstat_setheader(&msg.m_hdr, PGSTAT_MTYPE_BESTART);
- msg.m_databaseid = MyDatabaseId;
- msg.m_userid = GetSessionUserId();
memcpy(&msg.m_clientaddr, &MyProcPort->raddr, sizeof(msg.m_clientaddr));
- pgstat_send(&msg, sizeof(msg));
- }
+ else
+ MemSet(&msg.m_clientaddr, 0, sizeof(msg.m_clientaddr));
+ pgstat_send(&msg, sizeof(msg));
/*
* Set up a process-exit hook to ensure we flush the last batch of