On Tue, Sep 8, 2026 at 5:15 PM Chao Li <[email protected]> wrote:
>
> Hi,
>
> Here is a simple repro

> evantest=# create table p (a int, b int generated always as (a*2) virtual, 
> check (b<100));
> evantest=# create table c () inherits (p);
> evantest=# alter table c alter b set expression as (a*3);

See 
https://www.postgresql.org/message-id/flat/CACJufxEomSz3BwUGfk8A6MeAKj%3DCki5B%2BgYTbJO%3DACCJyytWZg%40mail.gmail.com
It seems my latest patch isn't working; I need to rebase it.

ALTER TABLE ONLY SET EXPRESSION also doesn't work in some cases.

> Is this a PG19-new bug? Not really. PG19 allows SET EXPRESSION on virtual 
> generated columns with CHECK constraints, but PG17 introduced SET EXPRESSION 
> for stored generated columns. This fix covers both virtual and stored 
> generated columns, so ideally it can be back-patched to PG17.
>

The required change is too extensive. For older branches, I think we
should raise an error, treating this as a new feature for the master
branch.



--
jian
https://www.enterprisedb.com/


Reply via email to