Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e8Bwf-0006we-4L for pgsql-hackers@arkaria.postgresql.org; Fri, 27 Oct 2017 21:13:37 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1e8Bwe-0007HX-Je for pgsql-hackers@arkaria.postgresql.org; Fri, 27 Oct 2017 21:13:36 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1e8Bwc-0007F2-LA for pgsql-hackers@postgresql.org; Fri, 27 Oct 2017 21:13:34 +0000 Received: from n3.nabble.com ([162.255.23.22]) by magus.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e8BwY-00074y-6q for pgsql-hackers@postgresql.org; Fri, 27 Oct 2017 21:13:33 +0000 Received: from n3.nabble.com (localhost [127.0.0.1]) by n3.nabble.com (Postfix) with ESMTP id C14FE91F1EF2 for ; Fri, 27 Oct 2017 14:13:27 -0700 (MST) Date: Fri, 27 Oct 2017 14:13:27 -0700 (MST) From: srielau To: pgsql-hackers@postgresql.org Message-ID: <1509138807748-0.post@n3.nabble.com> In-Reply-To: References: Subject: Re: MERGE SQL Statement for PG11 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org Simon, Nice writeup. While the standard may not require a unique index for the ON clause I have never seen a MERGE statement that did not have this property. So IMHO this is a reasonable restrictions. In fact I have only ever seen two flavors of usage: * Single row source (most often simply a VALUES clause) in OLTP In that case there was lots of concurrency * Massive source which affects a significant portion of the target table in DW. In this case there were no concurrent MERGEs I believe support for returning rows at a later stage would prove to be very powerful, especially in combination with chaining MERGE statements in CTEs. To do that would require language extensions to pass the coloring of the source row through, especially for rows that fell into "do nothing". -- Sent from: http://www.postgresql-archive.org/PostgreSQL-hackers-f1928748.html -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers