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 1nrMkR-0002WT-CO for pgsql-hackers@arkaria.postgresql.org; Wed, 18 May 2022 16:42:07 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nrMkP-0004PY-Ec for pgsql-hackers@arkaria.postgresql.org; Wed, 18 May 2022 16:42:05 +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 1nrMkP-0004PP-5l for pgsql-hackers@lists.postgresql.org; Wed, 18 May 2022 16:42:05 +0000 Received: from wout1-smtp.messagingengine.com ([64.147.123.24]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nrMkM-0005Jy-8U for pgsql-hackers@lists.postgresql.org; Wed, 18 May 2022 16:42:04 +0000 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id 50E75320024A; Wed, 18 May 2022 12:41:58 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Wed, 18 May 2022 12:41:59 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:reply-to:sender :subject:subject:to:to:x-me-proxy:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm1; t=1652892117; x=1652978517; bh=W 7AolAoTT5n1N/rooC95GqhCNB6WE2RDZLEkgMIbfnI=; b=mu0u2sAJghukArPdL WrGIjtJ2aGu2Nh2+KOyM3KysmQibWKDCOh7fVyW8vzSZTBggRTyK9W/t3m9VXLyU EK6Iuy6OBRjB/Jf/jLCnvjA4yzoL4WACmNefRrCLL08v/3V/rO1kNpiMk9y3XNI7 5YkTHKI6qOf8xi4UCKyfR3OxVnzDZDxAgnqxKOKj8WkJytQTV2HFxLhdaliCUEsL Y+CzDo4JWGsLVvG/lw0pgudP6PGnvsRictxxxl2h19bYutZJhHxPNGadKCUAIsuD CTYVlomu0VnAI63cgkp+Mtq3xquzqVJcihGlICbmtizLBFvwGZAzSTTblSvrX+nJ 7Mkog== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrheelgddutdduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvfevuffkgggtugfgjgesmhekreertddtjeenucfhrhhomheptehlvhgr rhhoucfjvghrrhgvrhgruceorghlvhhhvghrrhgvsegrlhhvhhdrnhhoqdhiphdrohhrgh eqnecuggftrfgrthhtvghrnhepudelkeekgfdttdettdekgfduvdeiffelteegjeeihfet heekveeftedtuddvhfeunecuffhomhgrihhnpegvnhhtvghrphhrihhsvggusgdrtghomh enucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrlhhv hhgvrhhrvgesrghlvhhhrdhnohdqihhprdhorhhg X-ME-Proxy: Feedback-ID: ia2694551:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 18 May 2022 12:41:57 -0400 (EDT) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id 44EBC2A1E42; Wed, 18 May 2022 18:42:38 +0200 (CEST) Date: Wed, 18 May 2022 18:42:38 +0200 From: Alvaro Herrera To: Justin Pryzby 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: <202205181642.3dlxbkt3f64g@alvherre.pgsql> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="2wzyrvwjlnwluax2" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20220511163350.GL19626@telsasoft.com> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --2wzyrvwjlnwluax2 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit On 2022-May-11, Justin Pryzby wrote: > 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/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. Reading the paragraph, I think it may be better to do it the other way around: first mention that concurrency is described in the MVCC page, then explain that INSERT ON CONFLICT also exists. What do you think of the attached? -- Álvaro Herrera Breisgau, Deutschland — https://www.EnterpriseDB.com/ --2wzyrvwjlnwluax2 Content-Type: text/x-diff; charset=utf-8 Content-Disposition: attachment; filename="v2-0001-Link-to-MVCC-docs-in-MERGE-docs.patch" From 5bad2c5a4bcd2bf04751f980f947c1050aeafd03 Mon Sep 17 00:00:00 2001 From: Alvaro Herrera Date: Wed, 18 May 2022 18:41:04 +0200 Subject: [PATCH v2] Link to MVCC docs in MERGE docs. --- doc/src/sgml/mvcc.sgml | 2 +- doc/src/sgml/ref/merge.sgml | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/doc/src/sgml/mvcc.sgml b/doc/src/sgml/mvcc.sgml index 341fea524a..4446e1c484 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 f68aa09736..6b94c863b5 100644 --- a/doc/src/sgml/ref/merge.sgml +++ b/doc/src/sgml/ref/merge.sgml @@ -539,6 +539,8 @@ MERGE total_count + See for more details on the behavior of + MERGE under concurrency. You may also wish to consider using INSERT ... ON CONFLICT as an alternative statement which offers the ability to run an UPDATE if a concurrent INSERT -- 2.30.2 --2wzyrvwjlnwluax2--