Re: ALTER COLUMN ... SET EXPRESSION to alter stored generated column's expression

amul sul <sulamul@gmail.com>

From: Amul Sul <sulamul@gmail.com>
To: Vaibhav Dalvi <vaibhav.dalvi@enterprisedb.com>
Cc: pgsql-hackers@postgresql.org
Date: 2023-08-28T09:54:12Z
Lists: pgsql-hackers

Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. ALTER TABLE command to change generation expression

  2. Refactor: separate function to find all objects depending on a column

  3. Turn AT_PASS_* macros into an enum

Attachments

On Thu, Aug 24, 2023 at 9:36 AM Vaibhav Dalvi <
vaibhav.dalvi@enterprisedb.com> wrote:

> Hi Amul,
>
>
> On Wed, Aug 2, 2023 at 4:06 PM Amul Sul <sulamul@gmail.com> wrote:
>
>> Hi,
>>
>> Currently, we have an option to drop the expression of stored generated
>> columns
>> as:
>>
>> ALTER [ COLUMN ] column_name DROP EXPRESSION [ IF EXISTS ]
>>
>> But don't have support to update that expression. The attached patch
>> provides
>> that as:
>>
>> ALTER [ COLUMN ] column_name SET EXPRESSION expression
>>
>> +1 to the idea.
>

Thank you.


> 3. The AlteredTableInfo structure has member Relation, So need to pass
> parameter Relation separately?
>
>> static ObjectAddress ATExecColumnExpression(AlteredTableInfo *tab,
>> Relation rel,
>>      const char *colName, Node *newDefault,
>>      bool missing_ok, LOCKMODE lockmode);
>
>
Yeah, but I think, let it be since other AT routines have the same.

Thanks for the review comments, I have fixed those in the attached version.
In
addition to that, extended syntax to have the STORE keyword as suggested by
Vik.

Regards,
Amul