model-writtenrun 5195 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Andre Lin reported that inherited UPDATE statements using MULTIEXPR initplans could fail assertions or raise an unexpected PARAM_MULTIEXPR ID error, supplying a regression-test reproducer in #1.
- Richard Guo argued that initplans could safely share output parameters in #2 and proposed an early return in #3; Tom Lane accepted the sharing rationale but rejected the shortcut because mixed initplans and regular subplans still needed selective renumbering in #4.
- Tom proposed appending subLinkId to SubPlan to preserve existing field offsets in #5; Andre explained why mixed subplan ordering also invalidated the offset calculation in #6, and Tom agreed that the mapping structure needed to change in #7.
- Tom attached the complete fix in #8, preserving SubLink IDs and explicitly mapping regular-subplan outputs while leaving initplan outputs alone; expanded regression cases also exposed multiple Params within one targetlist entry, requiring a full expression-tree walker.
- The thread ends with the attachment in #8, which subsequently landed as 174c929e3b with mapping-index adjustments, comment corrections, and branch adaptations; the commit states that only PostgreSQL 10–13 require the fix.