Reject child partition FDWs in FOR PORTION OF
Peter Eisentraut <peter@eisentraut.org>
Author:
Peter Eisentraut <peter@eisentraut.org>
Date: 2026-06-27T17:36:51Z
Releases:
19 (unreleased)
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: https://www.postgresql.org/message-id/flat/CA%2BrenyUte0_UJsJiDJQi82oaBsMJn%3Dcct0Wn%3DvOqXtuDn%3DYYJA%40mail.gmail.com
Files
| Path | Change | +/− |
|---|---|---|
| contrib/postgres_fdw/expected/postgres_fdw.out | modified | +39 −3 |
| contrib/postgres_fdw/sql/postgres_fdw.sql | modified | +27 −3 |
| src/backend/commands/copyfrom.c | modified | +1 −1 |
| src/backend/executor/execMain.c | modified | +10 −1 |
| src/backend/executor/execPartition.c | modified | +2 −2 |
| src/backend/executor/nodeModifyTable.c | modified | +1 −1 |
| src/backend/parser/analyze.c | modified | +0 −6 |
| src/include/executor/executor.h | modified | +1 −1 |
Discussion
- Move FOR PORTION OF checks out of analysis 10 messages · 2026-05-15 → 2026-06-27