agora inbox for pgsql-committers@postgresql.org  
help / color / mirror / Atom feed
From: Fujii Masao <fujii@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix misreporting of publisher sequence permissions during sync
Date: Sat, 20 Jun 2026 09:23:20 +0000
Message-ID: <E1warv6-0017V2-1b@gemulon.postgresql.org> (raw)

Fix misreporting of publisher sequence permissions during sync

When synchronizing sequences for logical replication, a
publisher-side permission failure could be reported as if the sequence
were missing on the publisher, making the real cause harder to
identify.

This happened because pg_get_sequence_data() returns a row of NULL
values when the replication connection lacks permission to read a
sequence. Sequence synchronization treated that the same as a missing
sequence, causing it to emit a misleading "missing sequence on
publisher" warning.

Fix this by distinguishing permission failures from genuinely missing
sequences. The synchronization query now checks whether the
replication connection has the required privilege for each published
sequence, allowing the worker to report permission failures
separately.

Author: Fujii Masao <masao.fujii@gmail.com>
Reviewed-by: Tristan Partin <tristan@partin.io>
Discussion: https://postgr.es/m/CAHGQGwGNTaXnBKUV510_P1KwhdbHT+kgZ4zU5njBHy7nCqdhzg@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/d4a657b0a4db72ca3fe1a02e851f776276a8d8a1

Modified Files
--------------
src/backend/replication/logical/sequencesync.c | 95 ++++++++++++++++++--------
src/test/subscription/t/036_sequences.pl       | 22 +++++-
2 files changed, 86 insertions(+), 31 deletions(-)



Message-ID: <E1warv6-0017V2-1b@gemulon.postgresql.org>
Permalink:  ../E1warv6-0017V2-1b@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1warv6-0017V2-1b@gemulon.postgresql.org

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: fujii@postgresql.org, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Fix misreporting of publisher sequence permissions during sync
  In-Reply-To: <E1warv6-0017V2-1b@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox