model-writtenrun 3214 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Alexander Lakhin reported that detaching a partition whose primary-key index was attached to a non-constraint parent index triggered an assertion, reproducing the problem from PostgreSQL 11 through master in #1; Michael Paquier argued that the inconsistent attachment should be rejected in #2.
- Tender Wang supplied another reproducer and a patch that skipped constraint detachment when the parent index had no constraint in #3, but Michael Paquier objected that this left the underlying attachment inconsistency unresolved in #4.
- Laurenz Albe independently reproduced the crash on PostgreSQL 17 beta in #8; the discussion established that assertions explained the differing observed behavior, while Alvaro Herrera proposed preventing new inconsistencies on master and preserving compatibility on stable branches in #11.
- Alvaro Herrera replaced the workaround with errors in all three attachment paths in #15, preferring rejection over silently creating another index; Michael Paquier supported errors and requested regression coverage in #16, while Alvaro clarified that older branches would instead receive a safe DETACH fix in #18.
- Alvaro Herrera reconsidered rejection because repairing existing databases could require expensive index rebuilds and disrupt uniqueness protection in #20, then attached a three-patch series containing the rewritten DETACH fix, attachment restrictions and a pg_upgrade rejection check in #22.
- Tender Wang approved the DETACH patch in #23, and Alvaro Herrera committed that portion as d0054432d4, crediting Tender as co-author and expanding the tests while lightly revising comments.
- Alvaro Herrera confirmed the push in #24; the DETACH fix was backpatched to supported branches, while the attachment restrictions and upgrade check remained parked under the plan in #22 until partitioned tables support ADD PRIMARY KEY USING INDEX.