Skip to content

Commit

Permalink
Merge pull request #537 from halvaborsch/halvaborsch-replication-slot…
Browse files Browse the repository at this point in the history
…-patch-1

Fix replication_slot query all supported versions
  • Loading branch information
SuperQ authored Jun 10, 2021
2 parents e43b976 + 29f6fa1 commit 134e908
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion cmd/postgres_exporter/postgres_exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,14 @@ var queryOverrides = map[string][]OverrideQuery{

"pg_replication_slots": {
{
semver.MustParseRange(">=9.4.0"),
semver.MustParseRange(">=9.4.0 <10.0.0"),
`
SELECT slot_name, database, active, pg_xlog_location_diff(pg_current_xlog_location(), restart_lsn)
FROM pg_replication_slots
`,
},
{
semver.MustParseRange(">=10.0.0"),
`
SELECT slot_name, database, active, pg_wal_lsn_diff(pg_current_wal_lsn(), restart_lsn)
FROM pg_replication_slots
Expand Down

0 comments on commit 134e908

Please sign in to comment.