model-writtenrun 4243 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Alexander Lakhin reported that changing a materialized view's access method allowed that method to be dropped, leaving the view unusable and preventing database dumps, with reproduction on PostgreSQL 15 through master #1.
- Michael Paquier traced the bug to relation rewriting: the temporary relation received the new access-method dependency, but the surviving relation did not; he proposed updating it in swap_relation_files() and supplied dependency regression tests #3.
- Michael corrected an accidental progress-reporting deletion #4, while Nathan Bossart endorsed the approach and explained why tablespace removal remained protected for relations with storage #5; Michael also checked the separate proposed partitioned-table support and identified a need for dependency tests there #8.
- Andres Freund requested validation of changeDependencyFor()'s return value #6, and Michael added an error unless exactly one dependency was handled #7.
- Michael then extended the fix to update both swapped relations, reasoning that callers might retain the second relation rather than immediately drop it; the resulting attachment also contained unrelated pg_waldump changes #9.
- Michael committed the access-method code and tests from #9 as 97d8910104, omitting the unrelated pg_waldump changes without a stated explanation and marking the fix for backpatching through PostgreSQL 15; his final message confirmed that both relations' dependencies were now updated and the reported bug was fixed #10.