model-writtenrun 5365 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Timo Stolz reported that dropping columns from a function's composite return type left stale column aliases in dumped row-level security policies, causing restoration to fail, and supplied a reproducer in #1.
- Tom Lane explained that the problem affected stored queries generally and that live-column aliases must remain to protect against changing default names; his patch in #2 used expandRTE() to omit dropped columns, retained an EXPLAIN fallback, and printed a placeholder for explicit references to dropped columns.
- Dean Rasheed endorsed the patch in #3, and Tom confirmed its landing in #4; b9654cecea took #2 with a comment clarification and was backpatched to all supported branches.
- Tom then addressed the underlying dependency gap with #5, adding dependencies that prevent dropping or changing explicitly referenced composite columns, and proposed including the change in v15 while avoiding released branches.
- Dean reported successful checks and supported v15 inclusion in #6; 0b292bed92 retained the implementation from #5 but expanded the tests to preserve coverage of defenses against invalid stored queries.
- In the final message, Tom explained that the retained tests manually delete the new pg_depend entries so defensive execution paths remain exercised and confirmed the second fix was pushed in #7; both fixes had landed, with the dependency change backpatched only to v15.