model-writtenrun 570 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Chao Li reported that UPDATE/DELETE FOR PORTION OF evaluated RETURNING for hidden leftover rows, advancing a sequence three times for one visible update, and proposed an explicit ExecInsert() control parameter in #1.
- Dean Rasheed highlighted that user-defined functions could access leftover rows without RLS SELECT checks and recommended deriving the decision from existing executor state instead of adding a parameter in #2.
- Chao implemented that recommendation in #3, checking both FOR PORTION OF and CMD_INSERT so cross-partition updates retained RETURNING, added regression coverage, and reported check-world passing; Paul A Jungwirth approved the fix in #4.
- Dean posted a refinement in #5 that moved the predicate to its use site, clarified comments, and replaced sequence tests with NOTICE output showing exactly which rows RETURNING evaluated.
- Paul reviewed the final version, verified CTE cases, and identified a commit-message typo in #6; his additional CTE tests were omitted, consistent with his assessment that they did not need inclusion, and Chao expressed agreement in #7.
- Dean committed #5 as fd92f74b91 with only the commit-message typo corrected and announced the push and backpatch to PostgreSQL 19 in #8; Chao thanked him in #9, closing the thread with the fix landed.