Re: Options to control remote transactions’ access/deferrable modes in postgres_fdw

From: Etsuro Fujita <etsuro(dot)fujita(at)gmail(dot)com>
To: Ashutosh Bapat <ashutosh(dot)bapat(dot)oss(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Options to control remote transactions’ access/deferrable modes in postgres_fdw
Date: 2025-05-08 08:50:43
Message-ID: CAPmGK150ucoQy96dUu6nu5iXBxyqrPrpqR2KMZN2CCSrMq0USw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sun, May 4, 2025 at 9:30 PM Etsuro Fujita <etsuro(dot)fujita(at)gmail(dot)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

Attachment Content-Type Size
Inherit-xact-properties-in-postgres-fdw-v4.patch application/octet-stream 16.0 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Álvaro Herrera 2025-05-08 09:53:32 Re: Remove unnecessary "lmgr.h" in stat_utils.c
Previous Message Yasir 2025-05-08 08:08:20 Valgrind - showing memory leaks