Disallow whole-row variables in GENERATED expressions. This was previously allowed, but I think that was just an oversight. It's a clear violation of the rule that a generated column cannot depend on itself or other generated columns. Moreover, because the code was relying on the assumption that no such cross-references exist, it was pretty easy to crash ALTER TABLE and perhaps other places. Even if you managed not to crash, you got quite unstable, implementation-dependent results.
Per report from Vitaly Ustinov. Back-patch to v12 where GENERATED came in. Discussion: https://postgr.es/m/cam_deiwr2dpt6u4xb-ehigozzd3n3g37zb1+867zbsevtyo...@mail.gmail.com Branch ------ REL_12_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/61feb8670824c8dfb66094f2a87df2395be0665c Modified Files -------------- src/backend/catalog/heap.c | 15 +++++++++++++-- src/test/regress/expected/generated.out | 7 +++++++ src/test/regress/sql/generated.sql | 3 +++ 3 files changed, 23 insertions(+), 2 deletions(-)
