Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Yv7Wi-0002n3-Jr for pgsql-hackers@arkaria.postgresql.org; Wed, 20 May 2015 17:11:28 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1Yv7Wi-0003uh-3N for pgsql-hackers@arkaria.postgresql.org; Wed, 20 May 2015 17:11:28 +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 1Yv7Wg-0003se-Eo for pgsql-hackers@postgresql.org; Wed, 20 May 2015 17:11:26 +0000 Received: from mail.anarazel.de ([217.115.131.40]) by magus.postgresql.org with esmtp (Exim 4.84) (envelope-from ) id 1Yv7Wa-00074F-L4 for pgsql-hackers@postgresql.org; Wed, 20 May 2015 17:11:25 +0000 Received: from intern.anarazel.de (unknown [184.23.178.130]) (Authenticated sender: andres@anarazel.de) by mail.anarazel.de (Postfix) with ESMTPSA id D0DA2860001; Wed, 20 May 2015 19:11:18 +0200 (CEST) Date: Wed, 20 May 2015 19:11:16 +0200 From: Andres Freund To: Thom Brown Cc: Peter Geoghegan , hlinnaka , Jeff Janes , Stephen Frost , Dean Rasheed , Bruce Momjian , Pg Hackers Subject: Re: INSERT ... ON CONFLICT UPDATE/IGNORE 4.0 Message-ID: <20150520171116.GE27868@alap3.anarazel.de> References: <20150508150340.GJ12950@alap3.anarazel.de> <20150520165406.GD27868@alap3.anarazel.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Pg-Spam-Score: -2.7 (--) 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 On 2015-05-20 18:09:05 +0100, Thom Brown wrote: > On 20 May 2015 at 17:54, Andres Freund wrote: > > On 2015-05-20 17:44:05 +0100, Thom Brown wrote: > >> The docs say "Note that exclusion constraints are not supported with > >> ON CONFLICT DO UPDATE." > >> > >> But I get the following error message text: > >> > >> "ERROR: there is no unique or exclusion constraint matching the ON > >> CONFLICT specification" > >> > >> 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? Greetings, Andres Freund -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers