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

Поиск
Список
Период
Сортировка
От Andres Freund
Тема Re: INSERT ... ON CONFLICT UPDATE/IGNORE 4.0
Дата
Msg-id 20150520171116.GE27868@alap3.anarazel.de
обсуждение исходный текст
Ответ на Re: INSERT ... ON CONFLICT UPDATE/IGNORE 4.0  (Thom Brown <thom@linux.com>)
Ответы Re: INSERT ... ON CONFLICT UPDATE/IGNORE 4.0  (Tom Lane <tgl@sss.pgh.pa.us>)
Список 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 по дате отправления:

Предыдущее
От: Thom Brown
Дата:
Сообщение: Re: INSERT ... ON CONFLICT UPDATE/IGNORE 4.0
Следующее
От: Tom Lane
Дата:
Сообщение: Re: INSERT ... ON CONFLICT UPDATE/IGNORE 4.0