Re: Checking Postgres Streaming replication delay - Mailing list pgsql-general

From Venkata B Nagothi
Subject Re: Checking Postgres Streaming replication delay
Date
Msg-id CAEyp7J_b4YnjtHQL364nXFUqonmaVqnD3m1Jvqp3TYSsUAdByw@mail.gmail.com
Whole thread Raw
In response to Checking Postgres Streaming replication delay  (Patrick B <patrickbakerbr@gmail.com>)
Responses Re: Checking Postgres Streaming replication delay  (Patrick B <patrickbakerbr@gmail.com>)
List pgsql-general

On Mon, Oct 31, 2016 at 11:57 AM, Patrick B <patrickbakerbr@gmail.com> 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,
pg_last_xlog_replay_location() replay,
(
extract(epoch FROM now()) -
extract(epoch FROM pg_last_xact_replay_timestamp())
)::int lag;

In your opinion, is that right?
Yes, thats right.

Regards,

Venkata B N
Database Consultant

pgsql-general by date:

Previous
From: Patrick B
Date:
Subject: Checking Postgres Streaming replication delay
Next
From: Andre Mikulec
Date:
Subject: Solution: On Windows with Mingw, how to Install PostgreSQL with zlib, pltcl, plperl, and plpython