diff --git a/collector/pg_replication.go b/collector/pg_replication.go index 790f85329..6067cc9b1 100644 --- a/collector/pg_replication.go +++ b/collector/pg_replication.go @@ -55,6 +55,7 @@ var ( pgReplicationQuery = `SELECT CASE WHEN NOT pg_is_in_recovery() THEN 0 + WHEN pg_last_wal_receive_lsn () = pg_last_wal_replay_lsn () THEN 0 ELSE GREATEST (0, EXTRACT(EPOCH FROM (now() - pg_last_xact_replay_timestamp()))) END AS lag, CASE