model-writtenrun 1379 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Alexander Lakhin reported that DELETE with WHERE false on a partitioned table containing a file_fdw partition raised an internal missing-ctid error when partition pruning was disabled #1.
- jian he proposed supplying a ctid through a new file_fdw callback #2; Tender Wang and Kirill Reshke confirmed improvements but questioned the differing EXPLAIN output and whether a non-updatable foreign table should instead produce a normal error #3 #4.
- Amit Langote moved the fix into the executor, allowing partitioned targets to lack ctid except for MERGE #8; Kirill accepted this approach after discussion, while Tender confirmed the fix but remained concerned about EXPLAIN differences #11 #12.
- Tom Lane argued that allowing or rejecting the command according to pruning exposed planner implementation details #15, and Amit demonstrated that earlier foreign-table checks would still behave differently with pruning enabled #16.
- David Rowley argued against checking every pruned partition because it could break workloads that archive old partitions through file_fdw and impose substantial metadata overhead #17; Amit agreed and initially favored the smaller executor fix for back-patching #18.
- Amit then reproduced the same failure with MERGE and revised the executor fix to recognize a sole dummy partitioned root, adding file_fdw regression coverage #20.
- Tender reported passing tests, and Kirill confirmed consistent DELETE behavior while requesting COSTS OFF #22 #23; Amit incorporated test cleanup and explanatory changes, then deferred committing to allow further review #24 #25.
- Amit developed an alternative planner fix that withheld tableoid when a child supplied no row identity, enabling the existing dummy-root fallback to add ctid #26; he explained that this made the targetlists consistent apart from relation-name qualification #27.
- Tender supplied missing postgres_fdw expected-output changes for the planner alternative #28, and Amit resumed it in January with clearer comments, simpler tests, and an explicit request for feedback on back-patch compatibility #29.
- Amit revised the planner alternative to preserve calls to AddForeignUpdateTargets whenever the callback exists #30, then proposed committing it despite its changes to EXPLAIN column ordering #31.
- Tom rejected the planner rewrite as too invasive for back-patching and unnecessary even for development, explaining that row-identity columns and EXPLAIN output legitimately depend on which children survive pruning #33; Amit accepted that reasoning and returned to the executor fix #34.
- The final attachment asserted that a partitioned result relation must be the sole dummy root, skipped its ctid requirement, adjusted the runtime assertion, and directly tested no-op DELETE, UPDATE, and MERGE commands #35.
- Amit committed the final executor implementation as 6d2fa44d2a, with light commit-message and test adaptations relative to #35; the supplied commit uses the older file_fdw test paths and omits MERGE tests.
- Amit announced that the fix had been pushed #36, closing the thread with the executor solution landed and back-patching recorded through PostgreSQL 14, while the planner rewrite remained uncommitted.