Re: Checking Postgres Streaming replication delay

From: Venkata B Nagothi <nag1010(at)gmail(dot)com>
To: Patrick B <patrickbakerbr(at)gmail(dot)com>
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: Checking Postgres Streaming replication delay
Date: 2016-10-31 02:54:23
Message-ID: CAEyp7J_b4YnjtHQL364nXFUqonmaVqnD3m1Jvqp3TYSsUAdByw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, Oct 31, 2016 at 11:57 AM, Patrick B <patrickbakerbr(at)gmail(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Andre Mikulec 2016-10-31 03:11:18 Solution: On Windows with Mingw, how to Install PostgreSQL with zlib, pltcl, plperl, and plpython
Previous Message Patrick B 2016-10-31 00:57:52 Checking Postgres Streaming replication delay