model-writtenrun 7807 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Peter Eisentraut proposed primary keys on existing system-catalog indexes to help GUI tools and eventually automate catalog diagrams, attaching a handwritten SQL implementation while leaving foreign keys outside the patch in #1.
- Andres Freund argued for keeping key declarations with catalog definitions instead of maintaining another manual list, while Tom Lane raised the need to pin the new constraints without retaining ordinary index dependencies in #6, #7, and #8.
- Peter reworked the implementation to generate primary-key and unique-constraint SQL from catalog-header annotations and execute it before dependency processing; he also identified a separately posted get_constraint_index prerequisite for pinned constraints in #10.
- Tom's detailed review requested generated-file cleanup, questioned the omission of security-label primary keys and the stability of generated ordering, and explained why the changed pg_constraint sanity-test output was correct in #11.
- The broader foreign-key idea encountered objections about unenforced constraints, zero OIDs representing absent references, and array-valued references; Tom proposed exposing relationship metadata through a function over a constant table instead in #12, #13, #14, and #17.
- Discussion weighed natural keys against OIDs, with Laurenz Albe emphasizing immutable identity and Peter retaining OIDs because other catalogs reference them; Peter's revision also fixed security-label coverage and generated-file cleanup in #16 and #25.
- Tom accepted the OID convention, withdrew his ordering concern after checking that generation used an array, and supplied a comment-only delta documenting the decisions before marking the patch ready for committer in #26.
- Joel Jacobson successfully tested the patch and asked about the two remaining catalogs without primary keys; Tom explained that pg_depend and pg_shdepend lacked suitable unique indexes and that adding them would impose cost and require duplicate-dependency cleanup in #27 and #28.
- Peter committed the implementation from #25 together with Tom's comment delta from #26 as dfb75e478c, confirming the integration in #30; the combined attachments exactly reproduce the committed file contents.
- Tom noticed the missing catalog-version bump after landing, and Peter agreed that another intervening bump had already made a separate correction unnecessary; they settled on requiring a bump when updated regression tests require initdb in #31, #32, #33, and #34.
- Follow-up discussion confirmed that a unique constraint on pg_depend failed during initdb because duplicate dependencies are permitted, with Julien Rouhaud and Tom identifying concrete sources of duplicates and explaining mixed dependency types in #35, #36, and #37.
- The thread ended with the catalog-key work landed and dependency catalogs still excluded; Peter returned with a Graphviz tool using PostgreSQL 14 relationship metadata, but reported that its diagram remained too unwieldy for documentation without further layout work in #39.