From 955a978e55bba01fbf420032887b364ea83103dd Mon Sep 17 00:00:00 2001 From: Francisco Miguel Biete Banon Date: Fri, 1 Sep 2023 18:06:01 +0100 Subject: [PATCH] WAL functions cannot be executed in standby servers Signed-off-by: Francisco Miguel Biete Banon --- cmd/postgres_exporter/queries.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cmd/postgres_exporter/queries.go b/cmd/postgres_exporter/queries.go index fa0b5c27..f6f3160e 100644 --- a/cmd/postgres_exporter/queries.go +++ b/cmd/postgres_exporter/queries.go @@ -82,6 +82,7 @@ var queryOverrides = map[string][]OverrideQuery{ ` SELECT slot_name, database, active, pg_xlog_location_diff(pg_current_xlog_location(), restart_lsn) FROM pg_replication_slots + WHERE pg_is_in_recovery() = False `, }, { @@ -89,6 +90,7 @@ var queryOverrides = map[string][]OverrideQuery{ ` SELECT slot_name, database, active, pg_wal_lsn_diff(pg_current_wal_lsn(), restart_lsn) FROM pg_replication_slots + WHERE pg_is_in_recovery() = False `, }, },