]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Fix misreporting of publisher sequence permissions during sync
authorFujii Masao <fujii@postgresql.org>
Sat, 20 Jun 2026 09:19:23 +0000 (18:19 +0900)
committerFujii Masao <fujii@postgresql.org>
Sat, 20 Jun 2026 09:19:23 +0000 (18:19 +0900)
commitd4a657b0a4db72ca3fe1a02e851f776276a8d8a1
treeb68516bc674e7377c915f588f871175f6fa535c3
parent73dab12719eec2996d8b033bb9d8bc2819cb0d4e
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
src/backend/replication/logical/sequencesync.c
src/test/subscription/t/036_sequences.pl