Re: Bypassing cursors in postgres_fdw to enable parallel plans

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Rafia Sabih <rafia(dot)pghackers(at)gmail(dot)com>
Cc: Yilin Zhang <jiezhilove(at)126(dot)com>, KENAN YILMAZ <kenan(dot)yilmaz(at)localus(dot)com(dot)tr>, Andy Fan <zhihuifan1213(at)163(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Bypassing cursors in postgres_fdw to enable parallel plans
Date: 2026-07-21 14:04:54
Message-ID: CA+TgmoaqY7vwDhG0-YoLVSVoApSqm5NF-qFHLkUcBY6n0xsvQg@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Jul 21, 2026 at 2:41 AM Rafia Sabih <rafia(dot)pghackers(at)gmail(dot)com> wrote:
> Yes you are right, this was based on the existing flow of pendingAreq, but also because we have access to conn_state in this function. In the functions pgfdw_cancel_query_end and pgfdw_get_cleanup_result we are only dealing with conn only, so clearing the conn_state there doesn't seem possible without significant changes.

I think you can add a parameter to pgfdw_cancel_query and
pgfdw_cancel_query_end, a PgFdwConnState. The callers in connection.c
have a ConnCacheEntry and can pass &entry->state, and the callers in
postgres_fdw.c have a PgFdwScanState and can pass fsstate->conn_state.

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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2026-07-21 14:06:51 Re: document the dangers of granting TRIGGER or REFERENCES
Previous Message Peter Eisentraut 2026-07-21 13:44:12 Re: Add missing period to DETAIL messages