model-writtenrun 2801 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Paul A Jungwirth demonstrated that changing a referenced column from a nondeterministic collation to a deterministic one could leave an invalid foreign key marked valid, then submitted a patch that remembered old collations and forced revalidation #1 #2.
- After reviewing Paul's patch, jian he replaced its collation lists with boolean flags passed through the ALTER TABLE machinery, then refined the comments and expanded tests while keeping that approach #3 #4 #5 #6.
- Tom Lane questioned whether nondeterministic foreign keys could preserve a unique referenced row, and jian he supplied examples of problematic mixed collations; Peter Eisentraut traced the issue to a SQL-standard rule that had changed back to requiring matching collations, while proposing compatibility for different deterministic collations #7 #8 #9.
- Jian explored a stricter solution that prohibited nondeterministic collations on either side of a foreign key, first as a code-only replacement and later with domain checks and regression tests #10 #12.
- Peter initially favored the smaller revalidation patch for backpatching, despite unnecessary checks when only the referencing collation changed, but concluded that a limited fix would leave other problems and would not be simpler #11 #13.
- Peter rewrote the solution to allow collations that were either identical or both deterministic, added collation-aware revalidation, and removed unnecessary COLLATE handling in referential-integrity triggers; he proposed applying this behavior change only to the development branch #13.
- Jian reviewed the rewrite's diagnostics, comments, OID checks, and referential-action behavior; Peter incorporated the cosmetic feedback and separately clarified the existing type-mismatch diagnostic in d7a2b5bd87, then posted the revised collation patch #14 #15 #17.
- Peter rejected the proposed parameter-collation comment change and explained that rejecting a distinct-but-equal primary-key update under RESTRICT was intentional; Jian continued testing and requested clearer documentation and broader coverage #16 #19 #18 #20 #21.
- Peter explained the distinction between NO ACTION and RESTRICT using both case-insensitive strings and signed floating-point zeroes, separated those questions from the collation fix, and declined backpatching without a feasible mitigation; Jian accepted the explanation while requesting documentation improvements #22 #23.
- The revised collation patch landed as 9321d2fdf8 with its implementation unchanged and light commit-message edits, and Peter confirmed completion of that part of the work #17 #24.
- Peter withdrew his suspicion of an additional update-execution bug and submitted three follow-up patches: use the dedicated RESTRICT error code, illustrate referential actions with case-insensitive tests, and explain NO ACTION versus RESTRICT more fully #25.
- The tests and documentation landed separately as 4a2dbfc6be and 1e08905842 from #25; the tests temporarily retained the existing diagnostic wording because the error-code patch had not yet landed.
- After the documentation commit, Marcos Pegoraro reported that NO UPDATE RESTRICT should read ON UPDATE RESTRICT, and Peter confirmed fixing the typo; this report came too late to count as review of the original documentation commit #26 #27.
- The remaining RESTRICT error-code patch landed as 086c84b23d, including updated expectations for the already-committed collation tests, and Peter declared all submitted follow-up patches committed and the thread concluded #25 #28.