Merge pull request #537 from halvaborsch/halvaborsch-replication-slot-patch-1

Fix replication_slot query all supported versions
This commit is contained in:
Ben Kochie 2021-06-10 11:27:16 +02:00 committed by GitHub
commit 134e908885
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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