]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Disallow USING clause when altering type of generated column
authorPeter Eisentraut <peter@eisentraut.org>
Thu, 29 Aug 2024 06:38:29 +0000 (08:38 +0200)
committerPeter Eisentraut <peter@eisentraut.org>
Thu, 29 Aug 2024 06:59:30 +0000 (08:59 +0200)
commitfdbf7e46a46d2ce8a215b37870b14ee2d7cf0fda
treeae158274dc78495cfad5df51e10ec4baf1110783
parent135007a1008c11e849036692ffe180dd7d4b5107
Disallow USING clause when altering type of generated column

This does not make sense.  It would write the output of the USING
clause into the converted column, which would violate the generation
expression.  This adds a check to error out if this is specified.

There was a test for this, but that test errored out for a different
reason, so it was not effective.

Reported-by: Jian He <jian.universality@gmail.com>
Reviewed-by: Yugo NAGATA <nagata@sraoss.co.jp>
Discussion: https://www.postgresql.org/message-id/flat/c7083982-69f4-4b14-8315-f9ddb20b9834%40eisentraut.org
src/backend/commands/tablecmds.c
src/test/regress/expected/generated.out