Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nopHk-0008En-P6 for pgsql-hackers@arkaria.postgresql.org; Wed, 11 May 2022 16:34:00 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nopHi-0006lN-KO for pgsql-hackers@arkaria.postgresql.org; Wed, 11 May 2022 16:33:58 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nopHi-0006l8-7x for pgsql-hackers@lists.postgresql.org; Wed, 11 May 2022 16:33:58 +0000 Received: from mail-qt1-x831.google.com ([2607:f8b0:4864:20::831]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1nopHe-0005tj-Lw for pgsql-hackers@lists.postgresql.org; Wed, 11 May 2022 16:33:57 +0000 Received: by mail-qt1-x831.google.com with SMTP id y3so2379417qtn.8 for ; Wed, 11 May 2022 09:33:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telsasoft-com.20210112.gappssmtp.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=Nj9BVfg9t1tEX8qjd7tZwdo6v2n2eSE0wwv5eO2WmgY=; b=QFQvJjLqFHRV/1KKFIsTv0r552W964lOH5jNGjwaqGJf7mu0ese+BNOqXDZ4x1vPbg lQ1Errhv1sKgjHmFav+7TGHYOuVCa49Ir76dCV2ODaHsfF43NO2RzAdjQrugQej43kk+ l1l2G6g9aOgkl2xfViPYAgrf9RtA/aLS7hE1aFaQJGg4yiHoOaR+aJcEICp/wIJdnjoa kEHYtLb8WTUvEc9WIlTcWMUBYDQYBckTCmzUi5xuZ2YrDB8r8fjh0wysyqFCwPBl0IOx IkpGsMUUQMOvQkB71RL36qgJX1n6sI6B2DYNjJ7gdY9fjGN5Hxgp+CQ1rpQLRXUIyY/y s+nA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=Nj9BVfg9t1tEX8qjd7tZwdo6v2n2eSE0wwv5eO2WmgY=; b=km3uKJxnQ0xfKqOGChVoJ6LlrvRKcg4em/4QbmImKT/vCEHTwA7/AwLgGxEiS+fe24 wZ87fHudKU7vzOsVS57l6NMsGl7ZU6ULNS8yjRMkIVhgP4mHmVQtP2nOIAo/9AuGfkjg ylwW3coWGuyB2mVF7OpVYWs3nEob0E9vlwHzrrRh4KB56ERj8e1/PCR7W26pxPFMbDNX ilSc4Br6Eibc3YBEvxjsntlN7EhQrAwjTCGS//ggxlAZOwcSq5t+VZr1lkoQ23JZjMOc 1E4WI6IzmF4TPAhATdSX3qADWCUjO7ybEoZD+qJdcmHu7XR8TI4Kak6cqxZ0sk+ukXLy zX0Q== X-Gm-Message-State: AOAM533fiMLUcqaRjZ3VyXwRabIDlWNsFRVBbwFs6rymdKGZrjVRjmha dqDNaW9J/51IOqqoAvzAolHAyg== X-Google-Smtp-Source: ABdhPJxkN52apD8cD3HSO7x6CeoxoAIumZrKOgKxwFaXoJVGBqaVfYI8hxVPIMlVOkYgFhS7dIaN8A== X-Received: by 2002:ac8:5d8a:0:b0:2f3:dcaa:f1c7 with SMTP id d10-20020ac85d8a000000b002f3dcaaf1c7mr13038374qtx.529.1652286833066; Wed, 11 May 2022 09:33:53 -0700 (PDT) Received: from pryzbyj.telsasoft (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id x22-20020ac85396000000b002f39b99f6c3sm1372129qtp.93.2022.05.11.09.33.51 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 11 May 2022 09:33:51 -0700 (PDT) Received: by pryzbyj.telsasoft (Postfix, from userid 1000) id 717DB8012C5; Wed, 11 May 2022 11:33:50 -0500 (CDT) Date: Wed, 11 May 2022 11:33:50 -0500 From: Justin Pryzby To: Alvaro Herrera Cc: Peter Eisentraut , Amit Langote , Japin Li , Zhihong Yu , Simon Riggs , pgsql-hackers@lists.postgresql.org, Tomas Vondra , Daniel Westermann , Erik Rijkers , Jaime Casanova , Andres Freund Subject: Re: support for MERGE Message-ID: <20220511163350.GL19626@telsasoft.com> References: <202203281100.qa7wqdu2ooyy@alvherre.pgsql> <202203281506.se4wtcvtvdq3@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202203281506.se4wtcvtvdq3@alvherre.pgsql> User-Agent: Mutt/1.9.4 (2018-02-28) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk I suggest to reference the mvcc docs from the merge docs, or to make the merge docs themselves include the referenced information. diff --git a/doc/src/sgml/mvcc.sgml b/doc/src/sgml/mvcc.sgml index 341fea524a1..4446e1c484e 100644 --- a/doc/src/sgml/mvcc.sgml +++ b/doc/src/sgml/mvcc.sgml @@ -425,7 +425,7 @@ COMMIT; MERGE allows the user to specify various combinations of INSERT, UPDATE - or DELETE subcommands. A MERGE + and DELETE subcommands. A MERGE command with both INSERT and UPDATE subcommands looks similar to INSERT with an ON CONFLICT DO UPDATE clause but does not diff --git a/doc/src/sgml/ref/merge.sgml b/doc/src/sgml/ref/merge.sgml index f68aa09736c..99dd5814f36 100644 --- a/doc/src/sgml/ref/merge.sgml +++ b/doc/src/sgml/ref/merge.sgml @@ -544,6 +544,7 @@ MERGE total_count UPDATE if a concurrent INSERT occurs. There are a variety of differences and restrictions between the two statement types and they are not interchangeable. + See for more information. Also, EXPLAIN output currently looks like this: | Merge on ex_mtarget t (actual rows=0 loops=1) | Tuples Inserted: 0 | Tuples Updated: 50 | Tuples Deleted: 0 | Tuples Skipped: 0 Should the "zero" rows be elided from the text output ? And/or, should it use a more compact output format ? There are two output formats already in use, so the options would look like this: Tuples: Inserted: 1 Updated: 2 Deleted: 3 Skipped: 4 or Tuples: inserted=1 updated=2 deleted=3 skipped=4 Note double spaces and capitals. That's separate from the question about eliding zeros.