model-writtenrun 2134 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Feike Steenbergen reported that a regular user could gain superuser privileges when a superuser selected a virtual generated column whose supposedly immutable function invoked malicious code, and supplied an exploit in #1.
- After initial disagreement over whether this merely reflected existing security risks, Feike emphasized that ordinary table reads were newly exposed in #6 and #8, and Robert Haas insisted that the feature must be fixed or reverted before release in #9.
- David G. Johnston proposed evaluating generation expressions as the table owner in #10, but Tom Lane explained that PostgreSQL lacked that infrastructure and that a RunAsUser expression wrapper could obstruct planner optimizations in #11.
- The discussion distinguished existing restore and view hazards from the new table-read exposure: Feike found that pg_dump omitted generated values in #12, while Tom explained existing pg_restore risks and the importance of distinguishing tables from views in #13 and #15.
- Jeff Davis proposed checking expression safety when columns are created in #18; Tom Lane warned about later changes to user-defined objects, suggested built-in functions as a conservative boundary, and leaned toward reverting the feature for PostgreSQL 18 in #19.
- The broader security discussion remained unresolved: Robert Haas favored a function-trust mechanism over changing execution identities because of compatibility and reverse-direction attacks in #24 and #27, while Jeff Davis raised trust granularity and usability concerns in #28.
- Peter Eisentraut offered a narrower way to retain the feature in #29: reject user-defined functions in virtual generation expressions now, leaving a future trust mechanism to expand what is allowed.
- Robert Haas challenged the safety of built-in functions in #32, but jian he and Christoph Berg pointed out that the existing immutability requirement excluded the dangerous examples in #33 and #34; Robert withdrew that specific objection while retaining his extensibility concern in #37, and Amit Kapila supported the restricted feature in #38.
- Peter discovered that the first patch checked only the expression's top level, so #39 added recursive traversal, rejected user-defined types to cover indirect function calls, and used FirstUnpinnedObjectId as the built-in boundary.
- jian he found missing tests and inconsistent acceptance of user-defined result types in #40, then supplied a CheckAttributeType() fix in #41; Peter incorporated the idea with a check covering all types and revised tests in #42, presenting two patches intended to be squashed.
- While reviewing that final series, jian he found that ALTER TABLE bypassed the virtual-column type checks and proposed an inline correction in #43; Peter treated this as an existing independent defect and committed 49fe1c83ec, covering both column addition and type alteration with regression tests, as confirmed in #44.
- Peter then committed both patches from #42 together as 0cd69b3d7e, preserving their implementation and tests while clarifying documentation and bumping the catalog version.
- Peter declared the topic closed in #45: both fixes had landed, while support for trusted user-defined functions and types remained future work rather than part of this solution.