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

From Tom Lane
Subject Re: INSERT ... ON CONFLICT UPDATE/IGNORE 4.0
Date
Msg-id 4215.1432143117@sss.pgh.pa.us
Whole thread Raw
In response to Re: INSERT ... ON CONFLICT UPDATE/IGNORE 4.0  (Andres Freund <andres@anarazel.de>)
Responses Re: INSERT ... ON CONFLICT UPDATE/IGNORE 4.0  (Andres Freund <andres@anarazel.de>)
List pgsql-hackers
Andres Freund <andres@anarazel.de> 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



pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: INSERT ... ON CONFLICT UPDATE/IGNORE 4.0
Next
From: Josh Berkus
Date:
Subject: Re: Disabling trust/ident authentication configure option