From: Magnus Hagander Date: Sun, 13 Dec 2015 15:53:38 +0000 (+0100) Subject: Consistently set all fields in pg_stat_replication to null instead of 0 X-Git-Tag: REL9_6_BETA1~1003 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a91bdf67c49ade2bdf6474607b64f9f0083db4a6;p=postgresql 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). --- 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))