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

git projects / postgresql.git / commit
? search:
summary | shortlog | log | commit | commitdiff | tree
(parent: bffe1bd) | patch
Fix handling of GENERATED columns in CREATE TABLE LIKE INCLUDING DEFAULTS.
2019年9月25日 21:30:42 +0000 (17:30 -0400)
2019年9月25日 21:30:42 +0000 (17:30 -0400)
commit b81a9c2fc52509025c635fa08ecaec1bad21441b
Fix handling of GENERATED columns in CREATE TABLE LIKE INCLUDING DEFAULTS.

LIKE INCLUDING DEFAULTS tried to copy the attrdef expression without
copying the state of the attgenerated column. This is in fact wrong,
because GENERATED and DEFAULT expressions are not the same kind of animal;
one can contain Vars and the other not. We *must* copy attgenerated
when we're copying the attrdef expression. Rearrange the if-tests
so that the expression is copied only when the correct one of
INCLUDING DEFAULTS and INCLUDING GENERATED has been specified.

Per private report from Manuel Rigger.

Tom Lane and Peter Eisentraut
src/backend/parser/parse_utilcmd.c diff | blob | blame | history
src/test/regress/expected/create_table_like.out diff | blob | blame | history
src/test/regress/sql/create_table_like.sql diff | blob | blame | history
This is the main PostgreSQL git repository.
RSS Atom

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