Commit a91bdf67 authored by Magnus Hagander's avatar Magnus Hagander

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).
parent 263c1957
...@@ -2822,6 +2822,9 @@ pg_stat_get_wal_senders(PG_FUNCTION_ARGS) ...@@ -2822,6 +2822,9 @@ pg_stat_get_wal_senders(PG_FUNCTION_ARGS)
else else
{ {
values[1] = CStringGetTextDatum(WalSndGetStateString(state)); values[1] = CStringGetTextDatum(WalSndGetStateString(state));
if (XLogRecPtrIsInvalid(sentPtr))
nulls[2] = true;
values[2] = LSNGetDatum(sentPtr); values[2] = LSNGetDatum(sentPtr);
if (XLogRecPtrIsInvalid(write)) if (XLogRecPtrIsInvalid(write))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment