Обсуждение: pgsql: Pass the correct PlannerInfo toPlanForeignModify/PlanDirectModi

Поиск
Список
Период
Сортировка

pgsql: Pass the correct PlannerInfo toPlanForeignModify/PlanDirectModi

От
Robert Haas
Дата:
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(-)