postgres.git / summary / log / commit / refs

commit    3d45edcef0e141f2a17a21d0411efa889f843b00
Author:   Alvaro Herrera <alvherre@alvh.no-ip.org>
Date:     Thu Nov 17 17:56:11 2022 +0000
First released in: 16.0, 15.2

    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


src/backend/executor/nodeModifyTable.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/backend/executor/nodeModifyTable.c b/src/backend/executor/nodeModifyTable.c index ca95c1d433a..d4e063e926a 100644 --- a/src/backend/executor/nodeModifyTable.c +++ b/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; [parent: 41afaa1ed4d4]