model-writtenrun 9744 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Amit Langote reported that detached partitions could lose foreign-key enforcement and that dropping their inherited foreign keys could fail; his initial series added missing action triggers and proposed replacing parent-child dependency records with inheritance recursion #1.
- Alvaro Herrera identified an ABI compatibility concern for PostgreSQL 11 and argued that attaching a partition should remove redundant action triggers, allowing detach to recreate them consistently #2 #3.
- Amit implemented that trigger lifecycle and demonstrated repeated attach/detach operations, while retaining the separate dependency-removal proposal #4.
- Alvaro revised trigger deletion to use an indexed catalog scan, avoided the ABI change by calling createForeignKeyActionTriggers directly, added regression tests, and supplied a separate relcache-invalidation fix discovered during testing #5.
- The action-trigger portion of #5 landed as 0464fdf07f with small code and test adjustments; Alvaro announced the push and requested a refreshed version of the remaining dependency patch #7 #8.
- Amit supplied the remaining patch for HEAD and PostgreSQL 11, but Alvaro questioned why its DefineIndex changes retained dependencies while other constraint paths removed them #9 #10.
- Amit abandoned dependency removal as too broad for this backpatched bug fix and instead proposed correcting inheritance metadata while preventing redundant non-CHECK constraint recursion in ATExecDropConstraint #11.
- Alvaro tested an alternative that deferred deletion until recursion finished, but differently named grandchild constraints defeated name-based lookup; Amit confirmed that this case had also caused him to abandon dependency removal, and they agreed to retain dependency-driven deletion #12 #13 #15.
- Both patches from #11 landed together as efd9366dce, with Alvaro adding parent-state validation, adjusting assertions, restricting the recursion shortcut to partitioned tables and refining tests #16.
- The thread ended with both targeted fixes committed and the dependency-removal and deferred-deletion alternatives abandoned; Amit confirmed that CHECK constraints likewise disappear with their parent constraint, while detaching a partition preserves its constraints #17.