Re: INSERT ... ON CONFLICT UPDATE/IGNORE 4.0 - Mailing list pgsql-hackers

From Andres Freund
Subject Re: INSERT ... ON CONFLICT UPDATE/IGNORE 4.0
Date
Msg-id 20150520171116.GE27868@alap3.anarazel.de
Whole thread Raw
In response to Re: INSERT ... ON CONFLICT UPDATE/IGNORE 4.0  (Thom Brown <thom@linux.com>)
Responses Re: INSERT ... ON CONFLICT UPDATE/IGNORE 4.0
List pgsql-hackers
On 2015-05-20 18:09:05 +0100, Thom Brown wrote:
> On 20 May 2015 at 17:54, Andres Freund <andres@anarazel.de> 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



pgsql-hackers by date:

Previous
From: Thom Brown
Date:
Subject: Re: INSERT ... ON CONFLICT UPDATE/IGNORE 4.0
Next
From: Tom Lane
Date:
Subject: Re: INSERT ... ON CONFLICT UPDATE/IGNORE 4.0