model-writtenrun 7074 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
Aug 2024 - Jan 2025 · 17 entries
- Alvaro Herrera revived the previously reverted effort to catalog table not-null constraints, requiring an explicit constraint beneath every primary-key column to simplify backend and pg_dump behavior; the opening patch initially hid those primary-key-associated constraints in verbose psql output #1.
- Tender Wang reviewed unused code, comments, and redundant lookups, while Jian He found system-column, domain, LIKE, and psql-query problems; Alvaro incorporated these fixes and repaired constraint-name/comment preservation during ALTER COLUMN TYPE in the next revision #2 #3 #4 #5 #10.
- Jian suggested including constraint names in not-null violation errors, but Alvaro's inline experiment questioned their practical value, and that executor change remained outside the submitted series #5 #8.
- Jian's inheritance examples exposed both overcounting during primary-key creation and undercounting through multiple inheritance; Alvaro removed visited-relation bookkeeping and changed primary-key preparation to queue one constraint addition per column on the target table #12 #14 #15 #16.
- Review also rejected the surprising behavior where DROP CONSTRAINT merely cleared a local-definition flag on an inherited constraint, and a deeper inheritance example prompted moving CommandCounterIncrement inside the child loop #17 #19 #21 #22 #24.
- The resulting revision passed pg_upgrade tests, preserved constraint names during dumping and propagation, removed obsolete tests, and made ALTER TABLE ONLY ADD PRIMARY KEY reject children lacking not-null constraints instead of silently scanning them #29.
- Further review made LIKE copy NO INHERIT constraints, rejected conflicting inheritability declarations, and eliminated unnecessary recursion from set_attnotnull; the revised patch also changed verbose psql output to show all not-null constraints #31 #35 #36 #37.
- Jian supplied a documentation fix for ordinary and foreign tables, which Alvaro folded into the series alongside duplicate-name checks, corrected UNIQUE handling, and a separate prerequisite allowing constraints to be dropped ONLY from partitioned parents #38 #40 #41 #43 #44.
- The next submission retained only the cataloging patch after the prerequisite's changes entered its base, introduced AttrMap-based inheritance matching, and fixed binary upgrades from older releases by identifying unnamed constraints through their columns #49.
- Alvaro abandoned automatic conversion of NO INHERIT constraints during attachment or inheritance, favoring consistent rejection and a future ALTER CONSTRAINT INHERIT command; he explicitly declined to hold up the initial feature for that command #48 #50 #51.
- Additional primary-key/NO INHERIT cases required parser checks beyond the earlier fixes, while Jian's tuple-descriptor shortcut simplified set_attnotnull; these changes reached the tested revision prepared for the November commitfest #50 #52 #53 #54 #55.
- Jian then showed that an invalid partitioned primary-key index allowed its underlying not-null constraint to be dropped, prompting restored relcache protection, a deferrable_ok lookup parameter, and a regression test #58 #59.
- After the October-to-November gap, Jian found that removing inheritance incorrectly processed NO INHERIT parent constraints; Alvaro fixed the scan, clarified inheritance documentation, and posted the intended final version with overflow checks #61 #62 #63.
- At final review, Alvaro declined a more complicated prevalidation rewrite but accepted missing constraint-OID initialization and Jian's correction making SERIAL/IDENTITY NO INHERIT rejection consistent between column and table syntax #64 #65 #66 #67.
- The main feature landed as 14e87ffa5c from #63 with those local parser and test additions; NOT VALID support and other extensions were deliberately outside the initial feature #34 #67.
- Tom Lane immediately reported compiler warnings from extractNotNullColumn and recommended direct array access; Alvaro posted an inline correction and committed ff239c3bf4, also simplifying the return and accepting the tiny DDL-lifetime allocation #68 #69 #70.
- In December, Jian traced StoreConstraints callers and identified unreachable CONSTR_NOTNULL handling, then submitted its removal with clearer comments; Alvaro committed it with light comment edits as 5b291d1c9c in January #71 #72 #73.
Apr 2025 · 6 entries
- In April, Tom supplied a reproducible parallel-restore deadlock involving partitioned tables and bisected it to the cataloging feature, reopening the thread for a locking fix #74.
- Tender's debugging located conflicting child and parent locks and showed that NoLock avoided the failure, but Alvaro preferred restructuring primary-key preparation so existing inheritable parent constraints eliminated child checks altogether; repeated runs of Tom's reproducer then passed #77 #78 #79.
- Tom noticed that the first fix never set got_children, and Alvaro's revision corrected that oversight, clarified comments, and checked child constraint validity and inheritability directly through pg_constraint with new tests #80 #81 #84.
- Tender reviewed both locking-fix versions, and the final attachment #84 landed as 11ff192b5b with only diagnostic and comment adjustments; although related discussions in thread #51371 and thread #138732 helped identify the problem, this thread contains the matching implementation #83 #85 #86.
- Tom's review arrived just after that landing and identified confusing comment grammar and a likely uninitialized-variable warning; his proposed wording and children initialization became fc5e966f73 the following day #87.
- The final exchange concerned combining ADD PRIMARY KEY and DROP NOT NULL in one ALTER TABLE statement: Tender reported the changed behavior, while Alvaro regarded the error as expected from execution-pass ordering and proposed no further patch, leaving no attached revision awaiting action in this thread #88 #89.