pgsql: Reject child partition FDWs in FOR PORTION OF

Started by Peter Eisentraut28 days ago1 messagescomitters
Jump to latest
#1Peter Eisentraut
peter_e@gmx.net

Reject child partition FDWs in FOR PORTION OF

We should defer validating FDW usage until after analysis. We have to
guard against not just the topmost table, but also individual child
partitions. Added the check to CheckValidResultRel, because it is
called after looking up child partitions (accounting for pruning), but
before the FDW can run a DirectModify update, which would bypass
per-tuple executor work.

Author: jian he <jian.universality@gmail.com>
Reported-by: Tom Lane <tgl@sss.pgh.pa.us>
Reviewed-by: Paul A. Jungwirth <pj@illuminatedcomputing.com>
Discussion: /messages/by-id/CA+renyUte0_UJsJiDJQi82oaBsMJn=cct0Wn=vOqXtuDn=YYJA@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/a40fdf658862b3221a35268f8c74abfd46b9e93c

Modified Files
--------------
contrib/postgres_fdw/expected/postgres_fdw.out | 42 ++++++++++++++++++++++++--
contrib/postgres_fdw/sql/postgres_fdw.sql | 30 ++++++++++++++++--
src/backend/commands/copyfrom.c | 2 +-
src/backend/executor/execMain.c | 11 ++++++-
src/backend/executor/execPartition.c | 4 +--
src/backend/executor/nodeModifyTable.c | 2 +-
src/backend/parser/analyze.c | 6 ----
src/include/executor/executor.h | 2 +-
8 files changed, 81 insertions(+), 18 deletions(-)