Determining replication lag - Mailing list pgsql-general

From rakeshkumar464
Subject Determining replication lag
Date
Msg-id 1480692380242-5933003.post@n3.nabble.com
Whole thread Raw
List pgsql-general
I found the following SQL in stackoverflow:

SELECT
  pg_last_xlog_receive_location() receive,
  pg_last_xlog_replay_location() replay,
  (
   extract(epoch FROM now()) -
   extract(epoch FROM pg_last_xact_replay_timestamp())
  )::int lag

I get different result in primary and slave. On primary the col lag always
shows some number, usually more than 3000, but on slave it is always zero.
Why the discrepancy ?





--
View this message in context: http://postgresql.nabble.com/Determining-replication-lag-tp5933003.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.


pgsql-general by date:

Previous
From: cen
Date:
Subject: Full text search randomly not working for short prefixes?
Next
From: Tom Lane
Date:
Subject: Re: Full text search randomly not working for short prefixes?