Re: Options to control remote transactions’ access/deferrable modes in postgres_fdw - Mailing list pgsql-hackers

From Ashutosh Bapat
Subject Re: Options to control remote transactions’ access/deferrable modes in postgres_fdw
Date
Msg-id CAExHW5vVwZdvW1Dfy3oJXVDBffJUvAwhaCw3HCSC38B1ie_H1A@mail.gmail.com
Whole thread Raw
In response to Re: Options to control remote transactions’ access/deferrable modes in postgres_fdw  (Etsuro Fujita <etsuro.fujita@gmail.com>)
Responses Re: Options to control remote transactions’ access/deferrable modes in postgres_fdw
List pgsql-hackers
On Tue, Mar 25, 2025 at 4:01 PM Etsuro Fujita <etsuro.fujita@gmail.com> wrote:
>
> In the patch I also fixed a bug; I trusted XactReadOnly to see if the
> local transaction is READ ONLY, but I noticed that that is not 100%
> correct, because a transaction which started as READ WRITE can show as
> READ ONLY later within subtransactions, so I modified the patch so
> that postgres_fdw opens remote transactions in READ ONLY mode if the
> local transaction has been declared READ ONLY at the top level.

Nice catch. postgres_fdw replicates the transaction stack on foreign
server. I think we need to replicate it along with the transaction
properties. And also we need a test which tests readonly
subtransaction behaviour.

--
Best Wishes,
Ashutosh Bapat



pgsql-hackers by date:

Previous
From: Andrew Dunstan
Date:
Subject: Re: getting "shell command argument contains a newline or carriage return:" error with pg_dumpall when db name have new line in double quote
Next
From: vignesh C
Date:
Subject: Re: Test to dump and restore objects left behind by regression