pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Heikki Linnakangas <heikki.linnakangas@iki.fi>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Include result relation info in direct modify ForeignScan nodes.
Date: Wed, 14 Oct 2020 08:59:18 +0000
Message-ID: <E1kSccw-0007zl-Nu@gemulon.postgresql.org> (raw)

Include result relation info in direct modify ForeignScan nodes.

FDWs that can perform an UPDATE/DELETE remotely using the "direct modify"
set of APIs need to access the ResultRelInfo of the target table. That's
currently available in EState.es_result_relation_info, but the next
commit will remove that field.

This commit adds a new resultRelation field in ForeignScan, to store the
target relation's RT index, and the corresponding ResultRelInfo in
ForeignScanState. The FDW's PlanDirectModify callback is expected to set
'resultRelation' along with 'operation'. The core code doesn't need them
for anything, they are for the convenience of FDW's Begin- and
IterateDirectModify callbacks.

Authors: Amit Langote, Etsuro Fujita
Discussion: https://www.postgresql.org/message-id/CA%2BHiwqGEmiib8FLiHMhKB%2BCH5dRgHSLc5N5wnvc4kym%2BZYpQEQ%40ma...

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/178f2d560dde05b356ab2f586b8bc62514f454aa

Modified Files
--------------
contrib/postgres_fdw/postgres_fdw.c     | 16 +++++++++-------
doc/src/sgml/fdwhandler.sgml            | 15 +++++++++------
src/backend/executor/nodeForeignscan.c  |  7 +++++++
src/backend/nodes/copyfuncs.c           |  1 +
src/backend/nodes/outfuncs.c            |  1 +
src/backend/nodes/readfuncs.c           |  1 +
src/backend/optimizer/plan/createplan.c |  4 ++++
src/backend/optimizer/plan/setrefs.c    |  4 ++++
src/include/nodes/execnodes.h           |  1 +
src/include/nodes/plannodes.h           |  8 ++++++++
10 files changed, 45 insertions(+), 13 deletions(-)



Message-ID: <E1kSccw-0007zl-Nu@gemulon.postgresql.org>
Permalink:  ../E1kSccw-0007zl-Nu@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1kSccw-0007zl-Nu@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: heikki.linnakangas@iki.fi
  Subject: Re: pgsql: Include result relation info in direct modify ForeignScan nodes.
  In-Reply-To: <E1kSccw-0007zl-Nu@gemulon.postgresql.org>
  References: <E1kSccw-0007zl-Nu@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox