Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Yv7qz-0003dr-0b for pgsql-hackers@arkaria.postgresql.org; Wed, 20 May 2015 17:32:25 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1Yv7qx-0005yH-EJ for pgsql-hackers@arkaria.postgresql.org; Wed, 20 May 2015 17:32:23 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1Yv7qw-0005yB-B4 for pgsql-hackers@postgresql.org; Wed, 20 May 2015 17:32:22 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1Yv7qt-0007S4-EW for pgsql-hackers@postgresql.org; Wed, 20 May 2015 17:32:21 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id t4KHVvpB004216; Wed, 20 May 2015 13:31:57 -0400 From: Tom Lane To: Andres Freund cc: Thom Brown , Peter Geoghegan , hlinnaka , Jeff Janes , Stephen Frost , Dean Rasheed , Bruce Momjian , Pg Hackers Subject: Re: INSERT ... ON CONFLICT UPDATE/IGNORE 4.0 In-reply-to: <20150520171116.GE27868@alap3.anarazel.de> References: <20150508150340.GJ12950@alap3.anarazel.de> <20150520165406.GD27868@alap3.anarazel.de> <20150520171116.GE27868@alap3.anarazel.de> Comments: In-reply-to Andres Freund message dated "Wed, 20 May 2015 19:11:16 +0200" Date: Wed, 20 May 2015 13:31:57 -0400 Message-ID: <4215.1432143117@sss.pgh.pa.us> X-Pg-Spam-Score: -0.4 (/) 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 Andres Freund writes: > On 2015-05-20 18:09:05 +0100, Thom Brown wrote: >>>> This implies that an exclusion constraint is valid in the statement, >>>> which contradicts the docs. Which one is correct? >>> ON CONFLICT can be used for ... DO NOTHING as well. >> Yes, but still confusing when not using DO NOTHING. > I'm not sure I can follow. INSERT INTO account VALUES(...) ON CONFLICT > (email) DO NOTHING; seems to make sense to me? Sure, but on what basis does it decide that there's a conflict? If you can't use an exclusion constraint to support the command, then the error message shouldn't be worded like that. regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers