Disallow USING clause when altering type of generated column
authorPeter Eisentraut <[email protected]>
Thu, 29 Aug 2024 06:38:29 +0000 (08:38 +0200)
committerPeter Eisentraut <[email protected]>
Thu, 29 Aug 2024 07:01:33 +0000 (09:01 +0200)
commitecd19a3cc1879118424ce730369dcfe3d7a41d75
tree502f83dde2ff0726591cd04f5370da66d884a014
parent6bc2bfc339ab44395fd0ef7a9bb30f8fdf205205
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 <[email protected]>
Reviewed-by: Yugo NAGATA <[email protected]>
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