Re: Disallow USING clause when altering type of generated column

From: Yugo Nagata <nagata(at)sraoss(dot)co(dot)jp>
To: Peter Eisentraut <peter(at)eisentraut(dot)org>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>, jian he <jian(dot)universality(at)gmail(dot)com>
Subject: Re: Disallow USING clause when altering type of generated column
Date: 2024-08-21 07:14:02
Message-ID: 20240821161402.7cd8987cdeb5f22e783cec11@sraoss.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, 21 Aug 2024 08:17:45 +0200
Peter Eisentraut <peter(at)eisentraut(dot)org> wrote:

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

I’m afraid you forgot to attach the patch.
It seems for me that this fix is reasonable though.

Regards,
Yugo Nagata

>
> There was a test for this, but that test errored out for a different
> reason, so it was not effective.
>
> discovered by Jian He at [0]
>
> [0]:
> https://www.postgresql.org/message-id/CACJufxEGPYtFe79hbsMeOBOivfNnPRsw7Gjvk67m1x2MQggyiQ@mail.gmail.com
>
>

--
Yugo Nagata <nagata(at)sraoss(dot)co(dot)jp>

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Anthonin Bonnefoy 2024-08-21 07:29:04 Re: [PATCH] Add additional extended protocol commands to psql: \parse and \bind
Previous Message Richard Guo 2024-08-21 07:10:51 Re: Eager aggregation, take 3