Re: Generated column is not updated (Postgres 13) - Mailing list pgsql-bugs

From Tom Lane
Subject Re: Generated column is not updated (Postgres 13)
Date
Msg-id 3568085.1621473509@sss.pgh.pa.us
Whole thread Raw
In response to Re: Generated column is not updated (Postgres 13)  ("David G. Johnston" <david.g.johnston@gmail.com>)
List pgsql-bugs
"David G. Johnston" <david.g.johnston@gmail.com> writes:
> FWIW I can definitely see where the OP is coming from with this - the
> expression at first blush, if one assumes PostgreSQL can handle the
> nuances, seems like a perfectly reasonable semantic way to express the
> programmer's desire.  Combined with the fact it used to work makes me want
> to lean toward keeping it working even if it takes come code hackery.

I dunno, I think it "used to work" only for exceedingly small values
of "work".  For me, the given test case hits the same assertion failure
in all versions back to v12, which is unsurprising because the code in
ATRewriteTable is about the same.

Also, considering only the table-rewrite code path is a mistake.
The fundamental problem here is that the behavior is ill-defined and
necessarily implementation-dependent; which makes it likely that other
code paths behave inconsistently with ALTER TABLE ADD COLUMN.

            regards, tom lane



pgsql-bugs by date:

Previous
From: David Rowley
Date:
Subject: Re: Less selective index chosen unexpectedly
Next
From: Mohan Nagandlla
Date:
Subject: Re: BUG #17023: wal_log_hints not configured even if it on