pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Dean Rasheed <dean.a.rasheed@gmail.com>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix MERGE command tag for actions blocked by BEFORE ROW triggers
Date: Mon, 13 Mar 2023 11:14:40 +0000
Message-ID: <E1pbg8V-003Jnt-PY@gemulon.postgresql.org> (raw)

Fix MERGE command tag for actions blocked by BEFORE ROW triggers.

This ensures that the row count in the command tag for a MERGE is
correctly computed in the case where UPDATEs or DELETEs are skipped
due to a BEFORE ROW trigger returning NULL (the INSERT case was
already handled correctly by ExecMergeNotMatched() calling
ExecInsert()).

Back-patch to v15, where MERGE was introduced.

Discussion: https://postgr.es/m/CAEZATCU8XEmR0JWKDtyb7iZ%3DqCffxS9uyJt0iOZ4TV4RT%2Bow1w%40mail.gmail.com

Branch
------
REL_15_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/da6257eee35db5d281a115838abaf285b46b52f3

Modified Files
--------------
src/backend/executor/nodeModifyTable.c | 10 ++++++----
src/test/regress/expected/merge.out    | 15 +++++++++++++++
src/test/regress/sql/merge.sql         | 13 +++++++++++++
3 files changed, 34 insertions(+), 4 deletions(-)



view thread (2+ messages)

Message-ID: <E1pbg8V-003Jnt-PY@gemulon.postgresql.org>
Permalink:  ../E1pbg8V-003Jnt-PY@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1pbg8V-003Jnt-PY@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: dean.a.rasheed@gmail.com
  Subject: Re: pgsql: Fix MERGE command tag for actions blocked by BEFORE ROW triggers
  In-Reply-To: <E1pbg8V-003Jnt-PY@gemulon.postgresql.org>
  References: <E1pbg8V-003Jnt-PY@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox