Problem
You'd like to know how big is the replication lag between master and slave on PostgreSQL.
Solution
You may run this query on your slave host:
SELECT EXTRACT(EPOCH FROM (now() - pg_last_xact_replay_timestamp()))::INT AS replication_lag;
You'd like to know how big is the replication lag between master and slave on PostgreSQL.
You may run this query on your slave host:
SELECT EXTRACT(EPOCH FROM (now() - pg_last_xact_replay_timestamp()))::INT AS replication_lag;