diff --git a/cmd/postgres_exporter/postgres_exporter.go b/cmd/postgres_exporter/postgres_exporter.go
index 36c524c8..b2e9f75b 100644
--- a/cmd/postgres_exporter/postgres_exporter.go
+++ b/cmd/postgres_exporter/postgres_exporter.go
@@ -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