model-writtenrun 2283 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
Feb - Apr 2025 ยท 25 entries
- Rushabh Lathia proposed adding NOT VALID and VALIDATE CONSTRAINT support for named NOT NULL constraints, initially changing pg_attribute.attnotnull into a three-valued character field and dumping invalid constraints after table data #1.
- Alvaro Herrera requested dump and upgrade coverage and found that validation incorrectly located inherited constraints by name; Rushabh introduced a dedicated validation routine and expanded tests, then supplied documentation and completion changes #2 #3 #6 #7.
- Alvaro's fix-up corrected child pg_attribute updates, reused existing constraint lookup functions, and traversed inheritance by column name rather than attribute number; Rushabh folded these changes into the full series with further checks and tests #8 #15.
- Ashutosh Bapat reported pg_upgrade failures, and after investigation Rushabh simplified the validation API and fixed pg_dump's handling of invalid constraints; Ashutosh confirmed that the upgrade tests passed #9 #16 #18 #23 #24.
- Ashutosh requested persistent inheritance test cases, and Alvaro clarified that an invalid parent constraint may have valid children, whereas a valid parent requires valid constraints in every child #24 #25.
- Alvaro reversed his initial support for changing attnotnull's type after examining external applications, prompting Rushabh to redesign the representation to preserve catalog compatibility #26 #27.
- Jian He explored representing invalid NOT NULL constraints as temporary CHECK constraints, but this introduced replacement and locking complications; Alvaro separately shared an experimental patch warning when CREATE TABLE ignores NOT VALID #28 #29.
- Rushabh proposed a separate attinvalidnotnull boolean, while Jian developed a variant in which valid and invalid constraints used mutually exclusive flags and initially excluded partitioned tables #30 #35.
- Alvaro insisted that attnotnull continue to indicate constraint existence, supported invalid constraints on partitioned parents, and explained when SET NOT NULL or ADD CONSTRAINT should validate an existing constraint; Jian added partition support and incorporated Rushabh's pg_dump code #33 #36 #37.
- Robert Haas questioned the claimed compatibility risk of changing a catalog column, but deferred to Alvaro's judgment; Jian adopted the positive attnotnullvalid flag while preserving attnotnull as the existence indicator #39 #41 #42 #43 #44.
- Alvaro reworked the implementation to cache validity in CompactAttribute.attnullability and update planner and JIT consumers, while deferring CREATE TABLE warnings to a separate discussion covering all constraint types #45.
- Jian identified inheritance metadata differences after dump and restore, missing validity checks, and complications from introducing a new archive object description; Alvaro retained the existing CONSTRAINT description and continued revising pg_dump #46 #49 #50 #52.
- Robert cautioned against using conislocal and coninhcount to represent validity, and Alvaro examined existing CHECK-constraint behavior before accepting comparable handling for NOT NULL constraints #51 #56.
- Rushabh added persistent inheritance and partition tests, while Jian supplied a fix-up preserving valid child constraints beneath invalid parents; Alvaro rejected extra catalog queries for an apparently cosmetic locality difference, and Jian moved the dump handling toward flagInhAttrs() #57 #58 #60 #61.
- Peter Eisentraut questioned duplicating validity metadata in pg_attribute when pg_constraint and CompactAttribute already carried the necessary information; NOT ENFORCED support was explicitly left for later because of the remaining development time #62 #63 #64.
- Rushabh consolidated the implementation, tests, and inheritance fixes into two patches, and Jian polished that series, removed unrelated test changes, and added CREATE TABLE LIKE coverage #66 #67.
- Alvaro accepted Peter's argument and removed the extra catalog column, deriving validity during the existing constraint scan and introducing an UNKNOWN cache state; he also deferred the disputed locality changes and removed postgres_fdw changes that failed testing #68 #69.
- Rushabh corrected the attribute loop and nullability initialization, and Jian reported that a table rewrite incorrectly checked invalid constraints and highlighted stale cached validity #70 #71.
- Alvaro committed the main feature from #70 with additional tuple-descriptor copying and equality checks, relcache invalidation, and rewrite fixes as a379061a22, reporting testing with debug_discard_caches enabled #72.
- Tom Lane then reported locale-dependent ordering failures in the new tests, and Alvaro reported fixing them #73 #74.
- Jian resubmitted the deferred pg_dump work with a concrete inheritance example showing that restoring a dump incorrectly changed validated child constraints to NOT VALID #76.
- After Nathan Bossart raised the release open item, Alvaro revised Jian's patch to use the existing locality flag, added dump and upgrade coverage, and separated the proposed backend conislocal change because its necessity remained unproven #77 #78 #79.
- Jian accepted the simpler dump implementation and requested comment corrections, while demonstrating that conislocal could still differ after a round trip without the separated backend patch #80.
- Alvaro committed the dump fix from #78 as 0e13b13d26, adding multiple-inheritance handling so a child constraint is not redundantly printed when any parent already supplies a valid constraint #81.
- The thread ended with the main feature and inherited-validity dump fix landed and the release open item declared closed; the backend locality adjustment remained uncommitted pending a test demonstrating a user-visible consequence #81.