Re: Generated column is not updated (Postgres 13)
Vitaly Ustinov <vitaly@ustinov.ca>
From: Vitaly Ustinov <vitaly@ustinov.ca>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Peter Eisentraut <peter.eisentraut@enterprisedb.com>,
pgsql-bugs@lists.postgresql.org, "David G. Johnston" <david.g.johnston@gmail.com>
Date: 2021-05-20T19:07:34Z
Lists: pgsql-bugs
In a BEFORE trigger (PL/pgSQL) I can access not yet computed generated columns via the "NEW" whole-row var. I can read from it (NULL), and I can write to it, but the assigned value will be ignored. This behavior seems obvious and well thought through to me. It's not something app developers should do, because it wouldn't make sense, but at least it's not forbidden and the server process does not crash with a seg fault. Is it okay with you that the patch 0002 introduces some inconsistency with that? Regards, Vitaly
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