model-writtenrun 5065 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- David Turoň reported that upgrading PostgreSQL 14 to 15 failed when restoring casts belonging to his extension, although ordinary dump and restore worked #1.
- Robert Haas reproduced an invalid restoration order: a function-based cast was restored before the binary-compatible cast it required, initially suggesting a recent pg_dump ordering change was responsible #2.
- Tom Lane identified a longstanding missing dependency in CastCreate and favored recording that dependency in the backend; he rejected a pg_dump workaround and limited the proposed fix to cast-to-cast dependencies because other object types appeared protected by dump ordering heuristics #3 #4.
- Tom Lane submitted a patch adding IsBinaryCoercibleWithCast and recording the prerequisite casts in pg_depend, with regression coverage; he left back-patching and replacing the existing API open for consideration #5.
- David Turoň confirmed the same failure when upgrading from PostgreSQL 9.6, supporting the longstanding-bug diagnosis, but did not report testing the patch; this was the thread's final message #6.
- Tom Lane subsequently committed #5 unchanged as 8272749e8c, retaining the separate API and declining back-patching because the bug was longstanding and existing databases would still lack the dependencies; broader dependency tracking remained outside the fix.