Re: BUG #17809: MERGE ... UPDATE fails with BEFORE ROW UPDATE trigger when target row updated concurrently

From: Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com>
To: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
Cc: exclusion(at)gmail(dot)com, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #17809: MERGE ... UPDATE fails with BEFORE ROW UPDATE trigger when target row updated concurrently
Date: 2023-03-13 11:42:39
Message-ID: CAEZATCU5gbK75xiYZ8cc0OCVDXuHe4b2Dt0X7wBLnm0yVSJXaA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Sun, 12 Mar 2023 at 11:14, Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com> wrote:
>
> On Sat, 11 Mar 2023 at 18:12, Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com> wrote:
> >
> > Attached is an updated patch that I'm more happy with now, and a
> > slightly modified one for v15, keeping the trigger API
> > backwards-compatible for extensions.
>
> If a BEFORE ROW trigger returns NULL to skip an update or delete,
> ExecMergeMatched() will still update estate->es_processed, and so the
> final row count in the command tag will be wrong. I'll tackle that in
> a follow-on patch, since it's really a separate bug.
>

OK, I have pushed fixes for both those issues.

Regards,
Dean

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Arne Roland 2023-03-13 11:43:09 Re: Invalid memory allocation error with pg_recvlogical or with libPQ logical connection
Previous Message Oleksandr Volkovskyi 2023-03-13 08:44:24 disable pipeline mode