Re: pg_replication_slot_advance to return NULL instead of 0/0 if slot not advanced

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Petr Jelinek <petr(dot)jelinek(at)2ndquadrant(dot)com>
Cc: Simon Riggs <simon(at)2ndquadrant(dot)com>, Magnus Hagander <magnus(at)hagander(dot)net>, Postgres hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pg_replication_slot_advance to return NULL instead of 0/0 if slot not advanced
Date: 2018-06-07 00:42:41
Message-ID: 20180607004241.GE24853@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Jun 06, 2018 at 04:57:22PM +0200, Petr Jelinek wrote:
> I think the only thing to note about the patches from my side is that we
> probably don't want to default to restart_lsn for the
> pg_logical_replication_slot_advance() return value (when nothing was
> done) but rather the confirmed_lsn. As it is in current patch if we call
> the function repeatedly and one call moved slot forward but the next one
> didn't the return value will go backwards as restart_lsn tends to be
> behind the confirmed one.

It does not matter much as the PG_TRY loop would still enforce the
result to confirmed_lsn anyway if nothing happens, still let's do as you
suggest as that's more consistent.
--
Michael

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Langote 2018-06-07 02:21:33 Re: Remove mention in docs that foreign keys on partitioned tables are not supported
Previous Message David Rowley 2018-06-07 00:27:58 Re: Spilling hashed SetOps and aggregates to disk