model-writtenrun 5691 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Kevin Humphreys reported that dropping a function without CASCADE silently removed a generated column using it, despite the expected RESTRICT behavior #1.
- Tom Lane traced the behavior to AUTO dependencies attached directly to generated columns and proposed NORMAL expression dependencies plus an INTERNAL link from each generation expression to its owning column #2; his examination of SQL:2021 confirmed that dependent generated columns should also prevent DROP COLUMN without CASCADE #3.
- Tom found that changing dependency types alone would confuse expression dependencies with the column's own type and collation dependencies, so he chose to attach them to pg_attrdef and update ALTER TABLE code that assumed the old arrangement #4.
- When Kevin asked about released versions and mitigation #5, Tom ruled out backpatching because changing existing catalog contents was too risky and targeted PostgreSQL 15 #6; David G. Johnston suggested a dummy view calling the function to enforce a protective dependency #7.
- Tom posted the complete draft, including lookup helpers extracted from objectaddress.c, dependency handling, information_schema changes, and regression tests; he also suggested moving pg_attrdef manipulation into its own file but had not implemented that relocation #8.
- In the last thread message, Peter Eisentraut observed that the standard's DROP ROUTINE rules did not explicitly address generation expressions, leaving a possible standards defect unresolved; the draft had no reported independent testing or approval #9.
- On March 21, Tom committed the draft's helper extraction separately and expanded it into a standalone pg_attrdef module, implementing the organizational change contemplated in #8 without changing dependency behavior 17f3bc0928.
- Tom then committed the remaining dependency fix and tests from #8, adding a catalog-version bump; the supplied commits establish that the work landed for PostgreSQL 15 after the thread ended, with no backpatch because of the catalog changes cb02fcb4c9.