Checking Postgres Streaming replication delay - Mailing list pgsql-general

From Patrick B
Subject Checking Postgres Streaming replication delay
Date
Msg-id CAJNY3ivSdN69zSpjrvVgarfRGfpOqDrY4YyfN08Uu2B74X7pSg@mail.gmail.com
Whole thread Raw
Responses Re: Checking Postgres Streaming replication delay
List pgsql-general
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?

Cheers
Patrick

pgsql-general by date:

Previous
From: Samuel Williams
Date:
Subject: Re: initdb createuser commands
Next
From: Venkata B Nagothi
Date:
Subject: Re: Checking Postgres Streaming replication delay