Re: Incorrect command tag row count for MERGE with a cross-partition update

Dean Rasheed <dean.a.rasheed@gmail.com>

From: Dean Rasheed <dean.a.rasheed@gmail.com>
To: Alvaro Herrera <alvherre@alvh.no-ip.org>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2023-02-22T09:50:05Z
Lists: pgsql-hackers
On Tue, 21 Feb 2023 at 09:34, Alvaro Herrera <alvherre@alvh.no-ip.org> wrote:
>
> > I think the best fix is to have ExecMergeMatched() pass canSetTag =
> > false to ExecUpdateAct(), so that ExecMergeMatched() takes
> > responsibility for updating estate->es_processed in all cases.
>
> Sounds sensible.
>

I decided it was also probably worth having a regression test covering
this, since it would be quite easy to break if the code is ever
refactored.

Pushed and back-patched.

Regards,
Dean



Commits

  1. Fix MERGE command tag for cross-partition updates.