Re: BUG #17823: Generated columns not always updated correctly

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: hisahiro@freemind.co.jp
Cc: pgsql-bugs@lists.postgresql.org
Date: 2023-03-06T16:35:29Z
Lists: pgsql-bugs

Attachments

PG Bug reporting form <noreply@postgresql.org> writes:
> I found that the generated columns are sometimes not updated.

Yeah.  Looking into nodeModifyTable.c, we miss re-doing
ExecComputeStoredGenerated when looping back after an EPQ update
(which is what this case is).  I see that we also fail to redo that
after a cross-partition move, which is a bug since 8bf6ec3ba.

The attached seems to be enough to fix it, but I want to also devise
an isolation test for these cases ...

			regards, tom lane

Commits

  1. Fix some more cases of missed GENERATED-column updates.

  2. Fill EState.es_rteperminfos more systematically.