Skip to content

Commit 134e908

Browse files
authored
Merge pull request #537 from halvaborsch/halvaborsch-replication-slot-patch-1
Fix replication_slot query all supported versions
2 parents e43b976 + 29f6fa1 commit 134e908

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

cmd/postgres_exporter/postgres_exporter.go

+8-1
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,14 @@ var queryOverrides = map[string][]OverrideQuery{
430430

431431
"pg_replication_slots": {
432432
{
433-
semver.MustParseRange(">=9.4.0"),
433+
semver.MustParseRange(">=9.4.0 <10.0.0"),
434+
`
435+
SELECT slot_name, database, active, pg_xlog_location_diff(pg_current_xlog_location(), restart_lsn)
436+
FROM pg_replication_slots
437+
`,
438+
},
439+
{
440+
semver.MustParseRange(">=10.0.0"),
434441
`
435442
SELECT slot_name, database, active, pg_wal_lsn_diff(pg_current_wal_lsn(), restart_lsn)
436443
FROM pg_replication_slots

0 commit comments

Comments
 (0)