Re: Options to control remote transactions’ access/deferrable modes in postgres_fdw
Etsuro Fujita <etsuro.fujita@gmail.com>
From: Etsuro Fujita <etsuro.fujita@gmail.com>
To: Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2025-05-08T08:50:43Z
Lists: pgsql-hackers
Attachments
- Inherit-xact-properties-in-postgres-fdw-v4.patch (application/octet-stream) patch v4
On Sun, May 4, 2025 at 9:30 PM Etsuro Fujita <etsuro.fujita@gmail.com> wrote: > As read-only > subtransactions can’t change to read-write, and a read-only > main-transaction can’t change to read-write after first snapshot, > either (note: begin_remote_xact is called after it), all we need to do > is track the nesting level of the outermost read-only transaction in > the local transaction and control the access mode of remote > transactions based on it so that they have the same access mode as the > local transaction at each subtransaction level, like the attached. I noticed that an assertion I added to pgfdw_subxact_callback fails when running some transactions. To fix, I just removed the assertion. Attached is an updated version of the patch. I also added a test case that was causing the failure, and tweaked some comments/docs a little bit. Best regards, Etsuro Fujita
Commits
-
postgres_fdw: Inherit the local transaction's access/deferrable modes.
- de28140ded8d 19 (unreleased) landed
- e5a3c9d9b5ce 18.0 landed
-
Revert "postgres_fdw: Inherit the local transaction's access/deferrable modes."
- 7d4667c6203d 18.0 cited