pgsql: Disallow USING clause when altering type of generated column

From: Peter Eisentraut <peter(at)eisentraut(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Disallow USING clause when altering type of generated column
Date: 2024-08-29 07:07:42
Message-ID: E1sjZFu-001wOv-7b@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

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(dot)universality(at)gmail(dot)com>
Reviewed-by: Yugo NAGATA <nagata(at)sraoss(dot)co(dot)jp>
Discussion: https://www.postgresql.org/message-id/flat/c7083982-69f4-4b14-8315-f9ddb20b9834%40eisentraut.org

Branch
------
REL_15_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/cf49a606c416634fd6af82eb559331fd6052835d

Modified Files
--------------
src/backend/commands/tablecmds.c | 13 ++++++++++++-
src/test/regress/expected/generated.out | 3 ++-
2 files changed, 14 insertions(+), 2 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Peter Eisentraut 2024-08-29 10:41:55 pgsql: Put generated_stored test objects in a schema
Previous Message Heikki Linnakangas 2024-08-29 07:01:13 pgsql: Rename some shared memory initialization routines