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

Peter Eisentraut <peter@eisentraut.org>

From: Peter Eisentraut <peter@eisentraut.org>
To: Amul Sul <sulamul@gmail.com>, Vaibhav Dalvi <vaibhav.dalvi@enterprisedb.com>
Cc: pgsql-hackers@postgresql.org
Date: 2023-10-06T12:33:40Z
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

On 28.08.23 11:54, Amul Sul wrote:
> 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.

An additional comment: When you change the generation expression, you 
need to run ON UPDATE triggers on all rows, if there are any triggers 
defined.  That is because someone could have triggers defined on the 
column to either check for valid values or propagate values somewhere 
else, and if the expression changes, that is kind of like an UPDATE.

Similarly, I think we should consider how logical decoding should handle 
this operation.  I'd imagine it should generate UPDATE events on all 
rows.  A test case in test_decoding would be useful.