model-writtenrun 9669 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Petr Fedorov reported that an UPDATE with RETURNING on a subpartitioned table produced zero output columns when its condition was false, causing a PL/pgSQL result-type error #1.
- Amit Langote reproduced the problem with ordinary inheritance and proposed initializing the dummy Result plan's target list, with a regression test #2.
- Tom Lane found that the proposed target list did not represent arbitrary RETURNING clauses, so he revised the patch to use the RETURNING column list and supplied direct UPDATE and EXPLAIN tests #4.
- Amit's investigation of the differing plan shapes exposed another consequence of omitting ModifyTable: statement-level triggers did not fire when all inheritance children were excluded #5; Tom agreed that ModifyTable must always be generated #6.
- Amit supplied a reworked patch that constructs a dummy child beneath ModifyTable, thereby fixing both output columns and statement triggers, and added trigger tests #7.
- Tom committed the reworked patch as ab5fcf2b04, adding check-option initialization, adjusting planner-state restoration, and polishing the tests; the commit records backpatching to all supported branches, and the thread closes with Tom's push announcement and Amit's thanks #8 #9.