Jeff Janes <jeff.janes@gmail.com> writes:
> I can reproduce the issue in all recent versions (didn't check before 12),
> including 15.0 and 16dev. You can see rows in which the generated column
> has a value inconsistent with the columns it is generated from.
My first guess about this is that we're failing to recalculate generated
columns in the EPQ code path where an update is re-applied to a
just-modified row. Can you tell whether the inconsistencies are
associated with rows that get updated twice in quick succession (by
different sessions)? Does the problem go away under serializable mode?
> If I copy the core expression of the immutable function into the generated
> column expression, leaving the function just for the monitoring query, then
> I never see the inconsistency.
Maybe that changes the timing?
regards, tom lane