model-writtenrun 1334 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Hüseyin Demir reported that upgrading from PostgreSQL 13 to 18.1 failed when an existing CHECK constraint occupied the name generated for a NOT NULL constraint, with renaming the CHECK constraint providing a workaround #1.
- Laurenz Albe traced the failure to CREATE TABLE and supplied a patch that passes existing constraints into NOT NULL constraint creation so generated names avoid collisions #2; he then added a regression test without changing the implementation #3.
- Dilip Kumar said the fix looked good but questioned collision handling for other constraint types #4; Laurenz demonstrated that ordinary ALTER TABLE name generation already worked, while explicitly named foreign-key or unique constraints restored after CREATE TABLE could still collide and remained outside this fix #5.
- Dilip confirmed that his additional CHECK-constraint example already received a nonconflicting generated name, resolving his concern #6.
- Hüseyin reviewed the test and suggested checking the generated names in pg_constraint #7; Laurenz preferred testing successful creation without depending on the exact generated name #8, and Hüseyin confirmed that the patch solved his PostgreSQL 18 problem #9.
- Álvaro Herrera committed the second patchset to master and PostgreSQL 18 as 8d9a97e0bb, moving name extraction into DefineRelation() so AddRelationNotNullConstraints() receives constraint names rather than CookedConstraint objects #12.
- Álvaro chose to document the added function argument instead of preserving the old API with a shim because third-party use seemed unlikely #12; 70eca789ea recorded the PostgreSQL 18 ABI exception, and he confirmed that the buildfarm check passed again #13.
- Laurenz accepted the committer's changes and agreed that the function's limited use justified changing its signature #14.
- Michael Paquier considered the committed fix safe but questioned landing it immediately before another release #15; Álvaro justified the timing by the low perceived risk and real upgrade failures #16, and Michael closed the thread with thanks #17, leaving both changes landed and the separately identified later-restored constraint collisions outside their scope.