Search Postgresql Archives

Determining replication lag

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.


-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux