How to determine replication lag - Mailing list pgsql-admin

From Murthy Nunna
Subject How to determine replication lag
Date
Msg-id BD7563973EF8894D905C80593EE9A4ED42CBC9@MAIL01.fnal.gov
Whole thread Raw
Responses Re: How to determine replication lag  (Dan Herzog <dherzog@marchex.com>)
List pgsql-admin

I am wondering if there is a way to find replication lag (in time seconds etc.) between primary and standby in case of STREAMING REPLICATION.

 

I can use the function pg_last_xact_replay_timestamp () as below. Only problem is IF THERE IS NO UPDATE ACTIVITY in primary database the output of the following query keeps increasing but in reality standby is in sync with primary data-wise.

 

 

SELECT EXTRACT (EPOCH FROM AGE(current_timestamp, pg_last_xact_replay_timestamp()) )

 

 

pgsql-admin by date:

Previous
From: Craig James
Date:
Subject: Re: Stuck LSI 9650SE-12 RAID Controller
Next
From: "Joseph Mays"
Date:
Subject: postgres-xc