Re: INSERT ... ON CONFLICT UPDATE/IGNORE 4.0

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: Thom Brown <thom(at)linux(dot)com>, Peter Geoghegan <pg(at)heroku(dot)com>, hlinnaka <hlinnaka(at)iki(dot)fi>, Jeff Janes <jeff(dot)janes(at)gmail(dot)com>, Stephen Frost <sfrost(at)snowman(dot)net>, Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com>, Bruce Momjian <bruce(at)momjian(dot)us>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: INSERT ... ON CONFLICT UPDATE/IGNORE 4.0
Date: 2015-05-20 17:31:57
Message-ID: 4215.1432143117@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin pgsql-hackers

Andres Freund <andres(at)anarazel(dot)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

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Andres Freund 2015-05-20 17:37:06 Re: INSERT ... ON CONFLICT UPDATE/IGNORE 4.0
Previous Message Andres Freund 2015-05-20 17:11:16 Re: INSERT ... ON CONFLICT UPDATE/IGNORE 4.0

Browse pgsql-hackers by date

  From Date Subject
Next Message Josh Berkus 2015-05-20 17:35:26 Re: Disabling trust/ident authentication configure option
Previous Message Andres Freund 2015-05-20 17:11:16 Re: INSERT ... ON CONFLICT UPDATE/IGNORE 4.0