Re: INSERT ... ON CONFLICT error messages

Поиск
Список
Период
Сортировка
От Peter Geoghegan
Тема Re: INSERT ... ON CONFLICT error messages
Дата
Msg-id CAM3SWZRo8zoyw0D2T3F1skNyK-jmwOP1u6i7wC1QB6XND9mTDA@mail.gmail.com
обсуждение исходный текст
Ответ на INSERT ... ON CONFLICT error messages  (Heikki Linnakangas <hlinnaka@iki.fi>)
Ответы Re: INSERT ... ON CONFLICT error messages  (Andres Freund <andres@anarazel.de>)
Список pgsql-hackers
On Tue, May 5, 2015 at 8:52 AM, Heikki Linnakangas <hlinnaka@iki.fi> wrote:
> I've read through all the error messages in the patch. Some comments:

I'll work through this feedback.

> postgres=# create table foo (id int4);
> CREATE TABLE
> postgres=# create unique index foo_y on foo (id) where id > 0;
> CREATE INDEX
> postgres=# insert into foo values (-1)  on conflict (id) where id > 0 do
> nothing;
> ERROR:  inferred arbiter partial unique index's predicate does not cover
> tuple proposed for insertion
> DETAIL:  ON CONFLICT inference clause implies that the tuple proposed for
> insertion must be covered by the predicate of partial index "foo_y".
>
> I'm surprised. If the inserted value doesn't match the WHERE clause of the
> constraint, there is clearly no conflict, so I would assume the above to
> work without error.

I'm not particularly attached to that behavior. I could revert it.


-- 
Peter Geoghegan



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

Предыдущее
От: Peter Geoghegan
Дата:
Сообщение: Re: INSERT ... ON CONFLICT syntax issues
Следующее
От: Fabien COELHO
Дата:
Сообщение: PATCH: pgbench allow '=' in \set