model-writtenrun 3160 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Alexander Lakhin reported that dropping a table's inheritance child, attaching the former parent as a partition, and updating a row beyond its partition constraint caused an assertion failure because the table was not recognized as a leaf partition #1.
- Tom Lane identified the stale pg_class.relhassubclass flag and confirmed that manually clearing it prevented the crash, proposing that partition attachment reset it after checking for inheritance children #2.
- Alvaro Herrera submitted a patch to reset the flag for ordinary tables in StorePartitionBound(), with a regression test in create_table.sql, and reported that his foreign-table experiment did not reproduce the problem #3.
- Tom Lane endorsed the patch and suggested extending the existing inheritance attachment test in alter_table.sql to avoid redundant setup #4.
- Alvaro Herrera committed the patch as 08b6a9ecf9, retaining its logic while clarifying the comment and adopting Tom's test placement; he confirmed completion and backpatching to all supported versions, although the connection to the previously cited historical change remained unexplained #5.