model-writtenrun 5951 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Дмитрий Иванов reported missing functions and problems restoring GENERATED ALWAYS columns while migrating from PostgreSQL 12 on Windows to PostgreSQL 14 on Debian #1; Tom Lane requested concrete examples and explained that identity values must be preserved during restoration #2.
- After examining the initial function definitions, Tom explained that pg_dump disables function-body checking to tolerate unresolved references during restoration, and his reconstructed example restored successfully #7.
- Дмитрий identified that views were emitted before the user-defined casts they used #12; Tom confirmed that dependency records referenced the cast implementation function rather than the cast, and rejected recording cast OIDs in expression nodes as invasive, unsuitable for backpatching, and troublesome for expression equality #13.
- Several attempts to supply a reproducer omitted required objects, prompting Tom to request a script that first loaded successfully and then reproduced the failure through dump and restore #17 #22; Дмитрий eventually supplied a tested example whose restored dump lost two views and a function #25.
- Tom traced the failure to a function returning a view's rowtype, which pulled the dependent views ahead of their required cast, and posted a patch that initially sorts casts before functions so dependency sorting can move their prerequisites ahead of them #26.
- Tom reported that the patch fixed the reduced example and requested testing against the real database #26; in the thread's final message, Дмитрий deferred that testing until he could apply the patch or obtain an update, leaving real-database validation pending #27.
- Tom subsequently committed the patch unchanged as b55f2b6926, with backports to all supported branches; the commit addresses cast ordering, while the original GENERATED ALWAYS and later money-format complaints remained unresolved in this thread #1 #8.