Re: Correct query to check streaming replication lag

From: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
To: Sameer Kumar <sameer(dot)kumar(at)ashnik(dot)com>
Cc: Granthana Biswas <granthana(at)zedo(dot)com>, PostgreSQL General Discussion Forum <pgsql-general(at)postgresql(dot)org>
Subject: Re: Correct query to check streaming replication lag
Date: 2014-01-21 04:37:28
Message-ID: CAB7nPqRBUJrat_o7LouTFp5vwt+xFATz=ycevSujccPFowM_+Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, Jan 21, 2014 at 1:30 PM, Sameer Kumar <sameer(dot)kumar(at)ashnik(dot)com>wrote:

>
> On Tue, Jan 21, 2014 at 12:12 PM, Michael Paquier <
> michael(dot)paquier(at)gmail(dot)com> wrote:
>
>> Mind you, here is a simple suggestion:
>> SELECT application_name, pg_xlog_location_diff(sent_location,
>> flush_location) AS replay_delta, sync_priority, sync_state FROM
>> pg_stat_replication ORDER BY replay_delta ASC, application_name;
>>
>
> This is much more simple, but I guess would work only with v9.2 and higher
> (?).
>
Yep, pg_xlog_location_diff is in core since 9.2.
--
Michael

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Granthana Biswas 2014-01-21 05:19:55 Re: Correct query to check streaming replication lag
Previous Message Sameer Kumar 2014-01-21 04:30:38 Re: Correct query to check streaming replication lag