model-writtenrun 9765 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Jesper Pedersen reported that ALTER TABLE ONLY ADD CONSTRAINT UNIQUE left a partitioned index marked INVALID; Alvaro Herrera explained that this was intentional until indexes on all partitions were attached #1 #2.
- Tom Lane proposed clearer INCOMPLETE terminology and opposed rejecting ONLY because it permits building partition indexes separately without locking the entire tree; Jesper accepted that the original issue concerned documentation and presentation, with no corresponding patch posted here #3 #7 #9.
- Alvaro identified a separate defect: adding a parent foreign key created duplicates when equivalent constraints already existed on partitions, although partition attachment already reused such constraints; he proposed reusing the existing cloning routine #8 #10.
- Amit Langote supplied a patch extracting the equivalent-constraint check into a shared helper called by both foreign-key creation and cloning #11.
- Alvaro replaced that approach with a three-patch series for PostgreSQL 11 that centralized constraint-row extraction, moved foreign-key cloning into tablecmds.c, and made foreign-key creation recurse through the cloning routine, with tests demonstrating elimination of duplicate constraints #12.
- Alvaro announced the series pushed; its third member became 0325d7a595, preserving the submitted implementation and SQL tests while adapting two expected-output headings for the development branch, with a PostgreSQL 11 backport #13 #12.
- After the commit, Amit endorsed the cloning approach and suggested applying similar behavior to CHECK constraints when attaching partitions; Alvaro treated that as a separate feature unsuitable for backpatching, so this exchange does not establish pre-commit review coverage #14 #15.
- The thread ended with the foreign-key fix landed and agreement to discuss CHECK-constraint cloning in a new hackers thread; whether to include ordinary inheritance remained open, with Amit noting that such support would need to skip non-inheritable parent constraints #16 #17 #18.