Skip to content

Commit a91bdf6

Browse files
committed
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).
1 parent 263c195 commit a91bdf6

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/backend/replication/walsender.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2822,6 +2822,9 @@ pg_stat_get_wal_senders(PG_FUNCTION_ARGS)
28222822
else
28232823
{
28242824
values[1] = CStringGetTextDatum(WalSndGetStateString(state));
2825+
2826+
if (XLogRecPtrIsInvalid(sentPtr))
2827+
nulls[2] = true;
28252828
values[2] = LSNGetDatum(sentPtr);
28262829

28272830
if (XLogRecPtrIsInvalid(write))

0 commit comments

Comments
 (0)