Disallow USING clause when altering type of generated column

Peter Eisentraut <peter@eisentraut.org>

Commit: fdbf7e46a46d2ce8a215b37870b14ee2d7cf0fda
Author: Peter Eisentraut <peter@eisentraut.org>
Date: 2024-08-29T06:59:30Z
Releases: 17.0
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

Files

PathChange+/−
src/backend/commands/tablecmds.c modified +12 −1
src/test/regress/expected/generated.out modified +2 −1

Discussion