Skip to content

Commit 28c3667

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 a9c56ff commit 28c3667

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
@@ -2826,6 +2826,9 @@ pg_stat_get_wal_senders(PG_FUNCTION_ARGS)
28262826
else
28272827
{
28282828
values[1] = CStringGetTextDatum(WalSndGetStateString(state));
2829+
2830+
if (XLogRecPtrIsInvalid(sentPtr))
2831+
nulls[2] = true;
28292832
values[2] = LSNGetDatum(sentPtr);
28302833

28312834
if (XLogRecPtrIsInvalid(write))

0 commit comments

Comments
 (0)