Re: Is it possible to find out write_lsn on standby?

From: Jehan-Guillaume de Rorthais <jgdr(at)dalibo(dot)com>
To: godjan • <g0dj4n(at)gmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Is it possible to find out write_lsn on standby?
Date: 2020-05-13 15:29:18
Message-ID: 20200513172918.19350262@firost
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello,

On Fri, 8 May 2020 18:25:02 +0500
godjan • <g0dj4n(at)gmail(dot)com> wrote:

> On primary I can execute ’SELECT write_lsn FROM pg_stat_replication;’ and get
> write_lsn of standby. I didn’t find function like "pg_last_write_lsn()” to
> get write_lsn on standby. Is it possible?

No, there's no admin function exposing it. The closest one is
pg_last_wal_receive_lsn() which is related to pg_stat_replication.flush_lsn.

There was discussions to create eg. pg_stat_wal_receiver view few weeks/moth
ago. But this is nowhere close to something. No patch ready yet.

Regards,

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2020-05-13 15:34:21 Re: Add "-Wimplicit-fallthrough" to default flags
Previous Message Tomas Vondra 2020-05-13 15:28:46 Re: SLRU statistics