Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Consistently set all fields in pg_stat_replication to null instead of 0
authorMagnus Hagander <magnus@hagander.net>
Sun, 13 Dec 2015 15:53:38 +0000 (16:53 +0100)
committerMagnus Hagander <magnus@hagander.net>
Sun, 13 Dec 2015 15:54:39 +0000 (16:54 +0100)
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

index ed7ece6c7e86f6e3cacdac0dc5ed2c6a34a730b8..6683b6fb4751c1e5b8fde449424df95953c0fd57 100644 (file)
@@ -2826,6 +2826,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))