model-writtenrun 2202 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Antonin Houska reported that PostgreSQL 18beta1 rejected valid data when validating a NOT VALID foreign key referencing a partitioned table, although PostgreSQL 17 accepted it #1.
- Tender Wang bisected the regression and explained that validation incorrectly checked the referencing rows against individual referenced partitions, which need not contain every referenced key #2 #3.
- Alvaro Herrera proposed directly marking referenced-side child constraints validated #4, but Tender Wang identified missing recursion, supplied a flag-based alternative, and demonstrated that deeper descendants remained unvalidated with the original patch #5 #6.
- jian he showed that suppressing all recursive scans could miss violations in referencing-side partitions and refined the flag logic #7; Amul Sul then renamed the flag to queueValidation and used relation identity to distinguish catalog-only recursion from required scans #8.
- jian he discovered the same failure when changing a foreign key to ENFORCED #9, Amul Sul proposed matching the constraint's referenced-table OID against the root OID #10, and jian he reported successful tests of that guard and the validation patch #11.
- Amul Sul combined both fixes with regression tests and clearer explanations of action-trigger constraints #12, then corrected the referenced-table terminology after jian he's review #13 #14.
- Alvaro Herrera found the flag-controlled function confusing and proposed a separate recursive helper for catalog-only updates #15; Amul Sul instead proposed passing the root referenced-table OID through the existing recursion, making validation and enforcement use the same queueing criterion #16.
- jian he endorsed the root-OID approach as more intuitive and accepted its commit message #17.
- Alvaro Herrera committed the NOT VALID portion of #16 as cc733ed164, preserving its production logic while revising comments and adding self-referential and multilevel-partition tests.
- Alvaro Herrera committed the ENFORCED portion of #16 separately as e6f98d8848, retaining its guard and tests with comment edits, and announced that both fixes had landed #18.
- Amul Sul accepted the split in the final message, leaving both fixes committed and no outstanding patch work identified in the thread #19.