Re: strem replication standby lag check

From: desmodemone <desmodemone(at)gmail(dot)com>
To: yhe <yinghe0101(at)yahoo(dot)com>
Cc: "pgsql-admin(at)postgresql(dot)org" <pgsql-admin(at)postgresql(dot)org>
Subject: Re: strem replication standby lag check
Date: 2014-01-20 12:33:48
Message-ID: CAEs9oFn1aHGzrbUYPFuqKFmpzD-Hz6VTgTy-5rL8Ld0PRRZ+sg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

I think it's better to use the pg_stat_replication

2014/1/17 yhe <yinghe0101(at)yahoo(dot)com>

> hi, all,
>
> I know we can connect to primary and SELECT pg_current_xlog_location();
> (eg.
> '0/36A77900') to get primary xlog position then connect to the standby to
> do
> the following to get the byte lag:
>
> select pg_xlog_location_diff('0/36A77900',pg_last_xlog_replay_location());
>
> 0/36A77900 is the xlog position from primary.
>
> My question is that is there a way I can connect to the primary on the
> standby host using replica user which i already have the primary_conninfo
> in
> the recovery.conf and get the result of SELECT pg_current_xlog_location();
> of the primary so I can simply write a function on the standby to return
> the
> lag in bytes in one call.
>
> any way I can do that without a dblink?
>
> Thank you if any one can help.
>
> best,
> Ying
>
>
>
>
>
> --
> View this message in context:
> http://postgresql.1045698.n5.nabble.com/strem-replication-standby-lag-check-tp5787682.html
> Sent from the PostgreSQL - admin mailing list archive at Nabble.com.
>
>
> --
> Sent via pgsql-admin mailing list (pgsql-admin(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-admin
>

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Sergey Konoplev 2014-01-21 02:32:02 Re: strem replication standby lag check
Previous Message desmodemone 2014-01-20 12:31:44 Re: pg_ctl promote