Hi,
On 2019-04-06 10:10:25 -0700, Andres Freund wrote:
> diff --git a/src/backend/access/heap/heapam_handler.c b/src/backend/access/heap/heapam_handler.c
> index add0d65f816..4bca240f367 100644
> --- a/src/backend/access/heap/heapam_handler.c
> +++ b/src/backend/access/heap/heapam_handler.c
> @@ -464,7 +464,7 @@ tuple_lock_retry:
> HeapTupleHeaderGetCmin(tuple->t_data) >= cid)
> {
> ReleaseBuffer(buffer);
> - return TM_Invisible;
> + return TM_SelfModified;
> }
This needs to set
tmfd->cmax = HeapTupleHeaderGetCmax(tuple->t_data);
so we don't throw
if (tmfd.cmax != estate->es_output_cid)
ereport(ERROR,
(errcode(ERRCODE_TRIGGERED_DATA_CHANGE_VIOLATION),
errmsg("tuple to be updated was already modified by an operation triggered by the current
command"),
errhint("Consider using an AFTER trigger instead of a BEFORE trigger to propagate changes
toother rows.")));
in the testcase at hand.
Greetings,
Andres Freund