Fix MERGE tuple count with DO NOTHING

Reporting tuples for which nothing is done is useless and goes against
the documented behavior, so don't do it.

Backpatch to 15.

Reported by: Luca Ferrari
Discussion: https://postgr.es/m/CAKoxK+42MmACUh6s8XzASQKizbzrtOGA6G1UjzCP75NcXHsiNw@mail.gmail.com
pull/138/head^2
Alvaro Herrera 3 years ago
parent 813492dacc
commit 6ff5aa1299
No known key found for this signature in database
GPG Key ID: 1C20ACB9D5C564AE
  1. 2
      src/backend/executor/nodeModifyTable.c

@ -2799,7 +2799,7 @@ lmerge_matched:
{
case TM_Ok:
/* all good; perform final actions */
if (canSetTag)
if (canSetTag && commandType != CMD_NOTHING)
(estate->es_processed)++;
break;

Loading…
Cancel
Save