Re: postgres_fdw: transaction mode inheritance corner cases - Mailing list pgsql-hackers

From Nikolay Samokhvalov
Subject Re: postgres_fdw: transaction mode inheritance corner cases
Date
Msg-id CAM527d_iZYxz9osL1Wra5=n0+WPTv3N3X-_3_XgVsd+EkTscdQ@mail.gmail.com
Whole thread
In response to Re: postgres_fdw: transaction mode inheritance corner cases  ("Matheus Alcantara" <matheusssilv97@gmail.com>)
Responses Re: postgres_fdw: transaction mode inheritance corner cases
List pgsql-hackers
On Wed, Sep 30, 2026 at 11:27 AM Matheus Alcantara
<matheusssilv97@gmail.com> wrote:
> With the patch, the new begin_remote_xact() call in create_cursor opens a
> remote SAVEPOINT s2 and creates the cursor inside it. ROLLBACK TO s1 then
> destroys the remote cursor while the local side still thinks it exists.

Thanks, Matheus. My AI harness for testing reproduced this on
REL_19_STABLE at 9e73b209 with Etsuro's v1 patch and prepared the
attached incremental patch. It declares the remote cursor before
advancing the remote savepoint level, then synchronizes the transaction
mode before FETCH. The second FETCH fails with 34000 on v1 and succeeds
with this patch.

The postgres_fdw suite passes (4/4). This does not address the hot
standby case, which needs a separate fix.

Nik

Attachment

pgsql-hackers by date:

Previous
From: Rui Zhao
Date:
Subject: Re: fix more casting away of qualifiers
Next
From: Jim Jones
Date:
Subject: Re: COMMENTS are not being copied in CREATE TABLE LIKE