pgsql: Pass the correct PlannerInfo toPlanForeignModify/PlanDirectModi - Mailing list pgsql-committers

From Robert Haas
Subject pgsql: Pass the correct PlannerInfo toPlanForeignModify/PlanDirectModi
Date
Msg-id E1fIz4b-0002PB-ST@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Pass the correct PlannerInfo to PlanForeignModify/PlanDirectModify.

Previously, we passed the toplevel PlannerInfo, but we actually want
to pass the relevant subroot.  One problem with passing the toplevel
PlannerInfo is that the FDW which wants to push down an UPDATE or
DELETE against a join won't find the relevant joinrel there.
As of commit 1bc0100d270e5bcc980a0629b8726a32a497e788, postgres_fdw
tries to do exactly this and can be made to fail an assertion as a
result.

It's possible that this should be regarded as a bug fix and
back-patched to earlier releases, but for lack of a test case that
fails in earlier releases, no back-patch for now.

Etsuro Fujita, reviewed by Amit Langote.

Discussion: http://postgr.es/m/5AF43E02.30000@lab.ntt.co.jp

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/7fc7dac1a711d0dbd01d2daf6dc97d27d6c6409c

Modified Files
--------------
contrib/postgres_fdw/expected/postgres_fdw.out | 75 ++++++++++++++++++++++++++
contrib/postgres_fdw/sql/postgres_fdw.sql      | 32 +++++++++++
src/backend/optimizer/plan/createplan.c        | 24 +++++----
3 files changed, 121 insertions(+), 10 deletions(-)


pgsql-committers by date:

Previous
From: Robert Haas
Date:
Subject: pgsql: Improve comment in get_partition_dispatch_recurse.
Next
From: Tom Lane
Date:
Subject: pgsql: Fix misprocessing of equivalence classes involving record_eq().