Re: Upsert with a partial unique index constraint violation

Поиск
Список
Период
Сортировка
От Peter Geoghegan
Тема Re: Upsert with a partial unique index constraint violation
Дата
Msg-id CAH2-Wzn_=rKu4Hhf-j85qZAajmmqtZ41abKugwqKTygj6Rn-UA@mail.gmail.com
обсуждение исходный текст
Ответ на Upsert with a partial unique index constraint violation  (Tim Dawborn <tim.dawborn@gmail.com>)
Ответы Re: Upsert with a partial unique index constraint violation  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: Upsert with a partial unique index constraint violation  (Tim Dawborn <tim.dawborn@gmail.com>)
Список pgsql-general
On Mon, Jul 11, 2016 at 12:06 AM, Tim Dawborn <tim.dawborn@gmail.com> wrote:
> tmp=# INSERT INTO foo (a, b, c, d) VALUES (1, 2, 'four', true)
> tmp-# ON CONFLICT (a, b) WHERE d = true
> tmp-# DO UPDATE SET c = 'four' WHERE foo.a = 1 AND foo.b = 2 AND foo.d =
> true;
> ERROR:  there is no unique or exclusion constraint matching the ON CONFLICT
> specification
>
> If anyone knows what I'm doing wrong and how to get this to work, or knows
> that this is not possible to achieve, I'm all ears.

That should work. Are you sure you haven't spelled it "... WHERE d IS TRUE"?

--
Peter Geoghegan


В списке pgsql-general по дате отправления:

Предыдущее
От: Tim Dawborn
Дата:
Сообщение: Upsert with a partial unique index constraint violation
Следующее
От: Nikhil
Дата:
Сообщение: BDR - Ignore already exists error during DDL replay