Re: Null value returned by function pg_last_wal_receive_lsn() in Logical Replication

From: pavan95 <pavan(dot)postgresdba(at)gmail(dot)com>
To: pgsql-admin(at)postgresql(dot)org
Subject: Re: Null value returned by function pg_last_wal_receive_lsn() in Logical Replication
Date: 2018-10-09 05:59:18
Message-ID: 1539064758346-0.post@n3.nabble.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Hi Community,

I configured Logical Replication in Postgres 10.5 using 2 nodes(Publisher
and Subscriber). I'm in my way to find lag in logical replication.

From the documentation I found that, pg_current_wal_lsn() on the publisher
and pg_last_wal_receive_lsn() on the subscriber helps us to find the lag in
which the subscriber is falling behind.

But, the function pg_last_wal_receive_lsn() is continuously returning NULL
value. In fact, all the Recovery Information
Functions(pg_last_wal_receive_lsn(),pg_last_wal_replay_lsn(),pg_last_xact_replay_timestamp())
are returning null.

From the Subscriber:

subscriber_db=# select pg_last_wal_receive_lsn();
pg_last_wal_receive_lsn
-------------------------

(1 row)

But according to documentation, the above 3 functions will return NULL only
if streaming replication is disabled or if it has not yet started. But in my
case, the logical replication is working fine. So I wanted to know if I
could get a value by enabling any settings recommended.

Also, is there a query to find the lag in bytes between publisher and
subscriber?

Thanks in Advance.

--
Sent from: http://www.postgresql-archive.org/PostgreSQL-admin-f2076596.html

Browse pgsql-admin by date

  From Date Subject
Next Message soumitra bhandary 2018-10-09 07:10:35 Re: Null value returned by function pg_last_wal_receive_lsn() inLogical Replication
Previous Message pavan95 2018-10-09 04:46:42 Re: Error when starting postgres database!!