agora inbox for pgsql-committers@postgresql.org
help / color / mirror / Atom feedFrom: Amit Kapila <akapila@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Allow logical replication workers to ignore default_transaction_
Date: Tue, 21 Jul 2026 04:02:06 +0000
Message-ID: <E1wm1gE-0000000072p-1LHy@gemulon.postgresql.org> (raw)
Allow logical replication workers to ignore default_transaction_read_only.
Sequence synchronization updates sequence state via setval(), which
explicitly calls PreventCommandIfReadOnly(). If
default_transaction_read_only is enabled on the subscriber, this causes
sequencesync workers to fail with "cannot execute setval() in a read-only
transaction". Apply and tablesync workers are not affected, since they
write via direct heap access rather than through these read-only-checked
functions.
Rather than special-casing sequencesync, override
default_transaction_read_only to "off" for all logical replication workers
in InitializeLogRepWorker(), the same way session_replication_role and
search_path are already forced there. This keeps the initialization
uniform.
For PG-19, we kept the fix narrow by overriding
default_transaction_read_only to "off" only for sequencesync workers.
Reported-by: Noah Misch <noah@leadboat.com>
Author: vignesh C <vignesh21@gmail.com>
Reviewed-by: Amit Kapila <amit.kapila16@gmail.com>
Backpatch-through: 19
Discussion: https://postgr.es/m/20260710045217.f0.noahmisch@microsoft.com
Branch
------
REL_19_STABLE
Details
-------
https://git.postgresql.org/pg/commitdiff/4cd02d552263ed8d4b148aaefd24cd9dd8af57ed
Modified Files
--------------
src/backend/replication/logical/sequencesync.c | 8 ++++
src/test/subscription/t/036_sequences.pl | 51 ++++++++++++++++++++++++++
2 files changed, 59 insertions(+)
view thread (2+ messages)
Message-ID: <E1wm1gE-0000000072p-1LHy@gemulon.postgresql.org>
Permalink: ../E1wm1gE-0000000072p-1LHy@gemulon.postgresql.org/
Also on: postgresql.org/message-id/E1wm1gE-0000000072p-1LHy@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: akapila@postgresql.org, pgsql-committers@lists.postgresql.org
Subject: Re: pgsql: Allow logical replication workers to ignore default_transaction_
In-Reply-To: <E1wm1gE-0000000072p-1LHy@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