git.postgresql.org Git - postgresql.git/commit

git projects / postgresql.git / commit
? search:
summary | shortlog | log | commit | commitdiff | tree
(parent: 30a3e77) | patch
Fix handling of generated columns in ALTER TABLE.
Wed, 8 Jan 2020 14:42:53 +0000 (09:42 -0500)
Wed, 8 Jan 2020 14:42:53 +0000 (09:42 -0500)
commit 4ac8aaa36fa24639989849c8109f8b52e9544fd1
Fix handling of generated columns in ALTER TABLE.

ALTER TABLE failed if a column referenced in a GENERATED expression
had been added or changed in type earlier in the ALTER command.
That's because the GENERATED expression needs to be evaluated
against the table's updated tuples, but it was being evaluated
against the original tuples. (Fortunately the executor has adequate
cross-checks to notice the mismatch, so we just got an obscure error
message and not anything more dangerous.)

Per report from Andreas Joseph Krogh. Back-patch to v12 where
GENERATED was added.

Discussion: https://postgr.es/m/VisenaEmail.200.231b0a41523275d0.16ea7f800c7@tc7-visena
src/backend/commands/tablecmds.c diff | blob | blame | history
src/test/regress/expected/generated.out diff | blob | blame | history
src/test/regress/sql/generated.sql diff | blob | blame | history
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /