Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eAWhs-0004C2-N2 for pgsql-hackers@arkaria.postgresql.org; Fri, 03 Nov 2017 07:48:00 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1eAWhs-0003Uy-9j for pgsql-hackers@arkaria.postgresql.org; Fri, 03 Nov 2017 07:48:00 +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 1eAWgL-0000fZ-4H for pgsql-hackers@postgresql.org; Fri, 03 Nov 2017 07:46:25 +0000 Received: from n3.nabble.com ([162.255.23.22]) by magus.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eAWgH-0007eu-Mh for pgsql-hackers@postgresql.org; Fri, 03 Nov 2017 07:46:24 +0000 Received: from n3.nabble.com (localhost [127.0.0.1]) by n3.nabble.com (Postfix) with ESMTP id 51D9B93B689C for ; Fri, 3 Nov 2017 00:46:20 -0700 (MST) Date: Fri, 3 Nov 2017 00:46:20 -0700 (MST) From: Thomas Kellerer To: pgsql-hackers@postgresql.org Message-ID: <1509695180333-0.post@n3.nabble.com> In-Reply-To: References: <20171030185511.GJ4628@tamriel.snowman.net> 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 PMFJI > We seem to have a few options for PG11 > > 1. Do nothing, we reject MERGE > > 2. Implement MERGE for unique index situations only, attempting to > avoid errors (Simon OP) > > 3. Implement MERGE, but without attempting to avoid concurrent ERRORs > (Peter) > > 4. Implement MERGE, while attempting to avoid concurrent ERRORs in > cases where that is possible. From an end-users point of view I would prefer 3 (or 4 if that won't prevent this from going into 11) INSERT ... ON CONFLICT is great, but there are situations where the restrictions can get in the way and it would be nice to have an alternative - albeit with some (documented) drawbacks. As far as I know Oracle also doesn't guarantee that MERGE is safe for concurrent use - you can still wind up with a unique key violation. -- 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