Re: Bypassing cursors in postgres_fdw to enable parallel plans - Mailing list pgsql-hackers

From Robert Haas
Subject Re: Bypassing cursors in postgres_fdw to enable parallel plans
Date
Msg-id CA+TgmoaSG5fdV4kK=uq2ETy1m=9b_XEOO+gz5K36e3orS7e3MQ@mail.gmail.com
Whole thread
In response to Re: Bypassing cursors in postgres_fdw to enable parallel plans  (Rafia Sabih <rafia.pghackers@gmail.com>)
List pgsql-hackers
On Fri, Jul 3, 2026 at 8:51 AM Rafia Sabih <rafia.pghackers@gmail.com> wrote:
> On Thu, 2 Jul 2026 at 19:57, Robert Haas <robertmhaas@gmail.com> wrote:
>> On Mon, Jun 29, 2026 at 5:27 AM Rafia Sabih <rafia.pghackers@gmail.com> wrote:
>> > So, do you suggest we can have a backpointer of conn also in active_fsstate...?
>>
>> I think that fsstate and active_fsstate have to be pointing to the
>> same conn_state object. Do you think otherwise?
>>
> No, but I don't understand why you think they can be different in the current implementation.
> Currently, as per init_scan fsstate->conn_state->active_scan = fsstate, and it is never reassigned or anything.
> So they cannot have different conn_state.
> Am I missing something?

I don't think they can be different. I think you shouldn't be passing
both of them, because save_to_tuplestore() is buggy if it ever
references fsstate. If you only pass active_fsstate, then that can't
happen.

--
Robert Haas
EDB: http://www.enterprisedb.com



pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: implement CAST(expr AS type FORMAT 'template')
Next
From: Robert Haas
Date:
Subject: Re: Proposal: Conflict log history table for Logical Replication