model-writtenrun 5675 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Tender Wang reported that MERGE could fail while initializing RETURNING when constraint exclusion removed an inheritance parent's scan and a surviving child had extra columns, even though INSERT still legitimately targeted the parent #1.
- Tender Wang's patch allowed missing columns in both the RETURNING and WITH CHECK OPTION attribute maps, because parent-derived expressions cannot reference child-only columns, and added regression tests for both paths #1.
- Keyerror Smart reproduced the failure, explained why ignoring child-only columns was safe, and successfully tested whole-row RETURNING, RLS as a non-superuser, and a child with a dropped column #2.
- Dean Rasheed committed the patch with expanded comments and reorganized regression tests that also covered whole-row RETURNING, retaining the original executor logic #1 7fffb11437.
- Dean Rasheed confirmed that the fix was pushed and backpatched through PostgreSQL 15, closing the thread with no outstanding work stated #3.