Subject: pgsql: Disable logical decoding after REPACK (CONCURRENTLY)

From: Álvaro Herrera <[email-masked]>
Date: Wed, 27 May 2026 18:14:40 +0000

Disable logical decoding after REPACK (CONCURRENTLY)

REPACK (CONCURRENTLY) uses a temporary logical replication slot, which
is dropped once done, but it wasn't calling RequestDisableLogicalDecoding(),
leaving effective_wal_level stuck at 'logical'.

Fix by adding a Boolean flag to ReplicationSlotDropAcquired() to have it
request to disable logical decoding, and passing it as true on REPACK.
Other callers of that function preserve their existing behavior.

Author: Imran Zaheer <[email-masked]>
Reviewed-by: shveta malik <[email-masked]>
Discussion: https://postgr.es/m/CA+UBfaktds57dw2M8BEv_kS-=[email-masked]

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/2af1dc89282bea681201cf66e2bb32537294e623

Modified Files
--------------
src/backend/commands/repack_worker.c           |  2 +-
src/backend/replication/logical/launcher.c     |  3 +-
src/backend/replication/logical/slotsync.c     | 10 ++++--
src/backend/replication/slot.c                 | 48 +++++++++++---------------
src/include/replication/slot.h                 |  2 +-
src/test/recovery/t/051_effective_wal_level.pl | 14 ++++++++
6 files changed, 47 insertions(+), 32 deletions(-)

---

From: Alexander Korotkov <[email-masked]>
Date: Wed, 27 May 2026 23:08:41 +0300

Hi!

> Discussion: https://postgr.es/m/CA+UBfaktds57dw2M8BEv_kS-=[email-masked]

This seams to cause buildfarm failures, for instance
https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=loach&dt=2026-05-27%2018%3A25%3A00

------
Regards,
Alexander Korotkov
Supabase

---

From: Masahiko Sawada <[email-masked]>
Date: Wed, 27 May 2026 15:55:11 -0700

> https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=loach&dt=2026-05-27%2018%3A25%3A00

I've just pushed the fix (47ad2233fad) and hope it makes buildfarm
members happy.

Regards,

-- 
Masahiko Sawada
Amazon Web Services: https://aws.amazon.com