Skip to content

Commit 069703e

Browse files
committed
Use COALESCE to change NULLs to zero-values in ccp_replication_slots query.
1 parent f8169c9 commit 069703e

File tree

6 files changed

+13
-13
lines changed

6 files changed

+13
-13
lines changed

internal/collector/eq_pg16_metrics.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@
88
SELECT
99
s.slot_name
1010
, s.active::int
11-
, pg_wal_lsn_diff(CASE WHEN pg_is_in_recovery() THEN pg_last_wal_replay_lsn() ELSE pg_current_wal_insert_lsn() END, s.restart_lsn) AS retained_bytes
12-
, s.database
11+
, COALESCE(pg_wal_lsn_diff(CASE WHEN pg_is_in_recovery() THEN pg_last_wal_replay_lsn() ELSE pg_current_wal_insert_lsn() END, s.restart_lsn), 0) AS retained_bytes
12+
, COALESCE(s.database, '')
1313
, s.slot_type
14-
, s.conflicting::int
14+
, COALESCE(s.conflicting::int, 0)
1515
, 0 AS failover
1616
, 0 AS synced
1717
FROM pg_catalog.pg_replication_slots s;

internal/collector/generated/eq_pg16_metrics.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

internal/collector/generated/gte_pg17_metrics.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)