model-writtenrun 2109 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Alexander Lakhin reported that altering a column referenced through another table's composite column and CHECK constraint triggered a missing-lock assertion, whereas production builds returned the expected unsupported-operation error #1.
- jian he reproduced the problem with exclusion constraints and proposed locking every affected constraint's table #2; Tom Lane agreed and retained the existing placement of composite-type dependency checks to preserve the possibility of future change propagation #3.
- Tom Lane posted the constraint-locking fix and regression test #4, which landed unchanged apart from base context as 13f1e9f26a, with backpatching through PostgreSQL 13.
- After that commit, jian he identified equivalent missing locks for dependent indexes and statistics #5, and Tom Lane asked him to prepare a follow-up patch #6.
- jian he's follow-up added exclusive locking for indexes, ShareUpdateExclusiveLock for statistics, and tests for ALTER TYPE and SET EXPRESSION, while also extending virtual-generated-column dependency handling #7.
- Tom Lane rejected the extra virtual-column restrictions because virtual expressions require no physical storage rewrite #8; jian he removed that logic and the virtual-column tests while retaining the locking fixes and stored-column tests #9.
- The remaining discussion questioned why stored generated columns prohibit SET EXPRESSION when their table's composite type is used elsewhere; Tom Lane favored considering removal of that restriction because generated expressions and defaults do not propagate to composite-type values #9 #10.
- Tom Lane ultimately reported pushing the follow-up bug fix with tests demonstrating the stored-versus-virtual inconsistency, leaving any behavioral change for a separate thread #11; that follow-up landing is not among the supplied candidates.