From a91bdf67c49ade2bdf6474607b64f9f0083db4a6 Mon Sep 17 00:00:00 2001 From: Magnus Hagander Date: Sun, 13 Dec 2015 16:53:38 +0100 Subject: [PATCH] Consistently set all fields in pg_stat_replication to null instead of 0 Previously the "sent" field would be set to 0 and all other xlog pointers be set to NULL if there were no valid values (such as when in a backup sending walsender). --- src/backend/replication/walsender.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/backend/replication/walsender.c b/src/backend/replication/walsender.c index c13567298c..7b1b7f1492 100644 --- a/src/backend/replication/walsender.c +++ b/src/backend/replication/walsender.c @@ -2822,6 +2822,9 @@ pg_stat_get_wal_senders(PG_FUNCTION_ARGS) else { values[1] = CStringGetTextDatum(WalSndGetStateString(state)); + + if (XLogRecPtrIsInvalid(sentPtr)) + nulls[2] = true; values[2] = LSNGetDatum(sentPtr); if (XLogRecPtrIsInvalid(write)) -- 2.40.0