Re: Generated column is not updated (Postgres 13)
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: "David G. Johnston" <david.g.johnston@gmail.com>
Cc: Vitaly Ustinov <vitaly@ustinov.ca>,
PostgreSQL mailing lists <pgsql-bugs@lists.postgresql.org>,
Peter Eisentraut <peter.eisentraut@enterprisedb.com>
Date: 2021-05-20T01:18:29Z
Lists: 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
Commits
-
Disallow whole-row variables in GENERATED expressions.
- 61feb8670824 12.8 landed
- 849c7971d1ab 13.4 landed
- 4b10074453d1 14.0 landed
-
Fix usage of "tableoid" in GENERATED expressions.
- dfe51ffbe78a 12.8 landed
- 77e3204ecbf1 13.4 landed
- 2b0ee126bbf0 14.0 landed