Skip to content

Commit 955a978

Browse files
authored
WAL functions cannot be executed in standby servers
Signed-off-by: Francisco Miguel Biete Banon <[email protected]>
1 parent 5890879 commit 955a978

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

cmd/postgres_exporter/queries.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,13 +82,15 @@ var queryOverrides = map[string][]OverrideQuery{
8282
`
8383
SELECT slot_name, database, active, pg_xlog_location_diff(pg_current_xlog_location(), restart_lsn)
8484
FROM pg_replication_slots
85+
WHERE pg_is_in_recovery() = False
8586
`,
8687
},
8788
{
8889
semver.MustParseRange(">=10.0.0"),
8990
`
9091
SELECT slot_name, database, active, pg_wal_lsn_diff(pg_current_wal_lsn(), restart_lsn)
9192
FROM pg_replication_slots
93+
WHERE pg_is_in_recovery() = False
9294
`,
9395
},
9496
},

0 commit comments

Comments
 (0)