Re: [GENERAL] Checking Postgres Streaming replication delay

2016-11-02 Thread Jim Nasby
On 10/31/16 3:39 PM, Patrick B wrote: |( ||extract(epoch FROMnow())- ||extract(epoch FROMpg_last_xact_replay_timestamp()) ||)::int lag| You could certainly simplify it though... extract(epoch FROM now()-pg_last_xact_replay_timestamp()) -- Jim Nasby, Data Architect, Blue Treble Consulting,

Re: [GENERAL] Checking Postgres Streaming replication delay

2016-10-31 Thread Patrick B
2016-10-31 15:54 GMT+13:00 Venkata B Nagothi : > > On Mon, Oct 31, 2016 at 11:57 AM, Patrick B > wrote: > >> Hi guys, >> >> I'm using this query to measure the delay between a Master and a >> Streaming Replication Slave server, using PostgreSQL 9.2.

Re: [GENERAL] Checking Postgres Streaming replication delay

2016-10-30 Thread Venkata B Nagothi
On Mon, Oct 31, 2016 at 11:57 AM, Patrick B wrote: > Hi guys, > > I'm using this query to measure the delay between a Master and a Streaming > Replication Slave server, using PostgreSQL 9.2. > > SELECT >> pg_last_xlog_receive_location() receive, >>

[GENERAL] Checking Postgres Streaming replication delay

2016-10-30 Thread Patrick B
Hi guys, I'm using this query to measure the delay between a Master and a Streaming Replication Slave server, using PostgreSQL 9.2. SELECT > pg_last_xlog_receive_location() receive, > pg_last_xlog_replay_location() replay, > ( > extract(epoch FROM now()) - > extract(epoch FROM