model-writtenrun 2291 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Kirill Reshke reported that reordered foreign key creation during dump/restore caused a duplicate constraint-name error, discovered while investigating a PostgreSQL 12-to-13 upgrade failure #1 #4.
- Tom Lane reproduced the failure directly with ALTER TABLE and traced it to an internal child constraint taking a name later requested by another constraint; psql hid the child entry, making the collision confusing #2 #3.
- Kirill briefly proposed letting dump scripts specify internal constraint names, then withdrew that idea; Alvaro Herrera instead advocated names less likely to collide with user choices and questioned backpatching the change #4 #5 #6.
- Tom supplied a first patch deriving child names from the parent constraint name, while deferring removal of the internal entries beyond PostgreSQL 18; Alvaro endorsed the patch and suggested future work on psql visibility and the underlying representation #7 #8.
- Tom revised ChooseConstraintName to append an underscore and digits to the parent name, accepting broader visible naming changes for PostgreSQL 18 only; Kirill reported that it worked, and Alvaro approved the revised version #10 #11 #12.
- Alvaro suggested detecting existing collisions in pg_upgrade --check, but Tom saw no simple implementation and chose to stop at improving generated names, leaving upgrade prechecks and deeper structural changes unimplemented in this thread #12 #13.
- After announcing his intention to push in the final message, Tom committed #10 unchanged as 3db61db48e, reducing collision risk and making child names more recognizable without backpatching the user-visible naming change #13.