pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: Disallow whole-row variables in GENERATED expressions. 3+ messages / 1 participants [nested] [flat]
* pgsql: Disallow whole-row variables in GENERATED expressions. @ 2021-05-21 19:13 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 3+ messages in thread From: Tom Lane @ 2021-05-21 19:13 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org 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+867zbsEVtYoJww@mail.gmail.com Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/4b10074453d182b5fc11a5667bab2ef8532ff3a6 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(-) ^ permalink raw reply [nested|flat] 3+ messages in thread
* pgsql: Disallow whole-row variables in GENERATED expressions. @ 2021-05-21 19:13 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 3+ messages in thread From: Tom Lane @ 2021-05-21 19:13 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org 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+867zbsEVtYoJww@mail.gmail.com Branch ------ REL_13_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/849c7971d1abe39d9105a768918c110414029e48 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(-) ^ permalink raw reply [nested|flat] 3+ messages in thread
* pgsql: Disallow whole-row variables in GENERATED expressions. @ 2021-05-21 19:13 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 3+ messages in thread From: Tom Lane @ 2021-05-21 19:13 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org 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+867zbsEVtYoJww@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(-) ^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2021-05-21 19:13 UTC | newest] Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2021-05-21 19:13 pgsql: Disallow whole-row variables in GENERATED expressions. Tom Lane <tgl@sss.pgh.pa.us> 2021-05-21 19:13 pgsql: Disallow whole-row variables in GENERATED expressions. Tom Lane <tgl@sss.pgh.pa.us> 2021-05-21 19:13 pgsql: Disallow whole-row variables in GENERATED expressions. Tom Lane <tgl@sss.pgh.pa.us>
This inbox is served by DDX for PostgreSQL; see mirroring instructions for how to clone and mirror all data and code used for this inbox