model-writtenrun 4312 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Sami Imseih reported that restoring a BEGIN ATOMIC function using ON CONFLICT ON CONSTRAINT failed because pg_dump placed the function before its required primary-key constraint #1.
- Tom Lane diagnosed a dependency loop involving the function, constraint, and dump-section boundaries, then posted a patch modeled on materialized-view handling that allows affected functions to move into post-data #2.
- Tom also proposed exposing otherwise hidden dependency-loop details as warnings, but Kirk Wolak and Sami objected that repeated warning labels would misleadingly suggest multiple problems #2 #3 #4.
- Sami successfully tested the function-ordering patch on the original reproducer and other cases, questioned aggregate-field initialization and the explanatory comment, and requested documentation of dependency tracking for SQL-standard function bodies #4.
- Tom posted two independent logging alternatives—warning-detail calls or a manually assembled multiline message—and Kirk preferred the labeled-detail presentation #5 #6.
- The logging fix landed as b3f32a6c31, with 751ba1a7c1 its listed backport, adopting the simpler alternative, removing manual indentation, and fixing adjacent foreign-key-loop details and hints.
- The function-ordering patch landed as 0161074786, with d6f549d7a6 its listed backport, retaining the submitted implementation and adding regression tests for function and materialized-view ordering.
- Sami's documentation request produced 0211544969, with 1b322c1fae its listed backport, explaining why parsed SQL-standard bodies have tracked dependencies while string-literal bodies generally do not.
- Tom explained that aggregate initialization remained to avoid an undefined field, rejected wording that unnecessarily limited the problem to BEGIN ATOMIC, and invited a broader documentation audit beyond the correction already committed #7.
- Tom confirmed choosing warning-detail calls and dropping extra indentation for modularity and translation reasons, leaving the manually assembled multiline alternative unused #8.
- Morris de Oryx subsequently described the same failure blocking an RDS upgrade, and Tom directed him to the already committed fix; Morris also requested fuller upgrade logs to make such failures diagnosable #9 #11 #14.
- The thread ended with all three changes committed: Álvaro Herrera confirmed their inclusion in the forthcoming PostgreSQL 14.9 and 15.4 releases, Morris reported that RDS would wait for numbered releases, and he acknowledged the confirmation #16 #17 #18.