Re: BUG #16714: INSERT ON CONFLICT DO UPDATE fails to infer constraint if it's not at top-level partition

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: BUG #16714: INSERT ON CONFLICT DO UPDATE fails to infer constraint if it's not at top-level partition
Дата
Msg-id 288078.1605283397@sss.pgh.pa.us
обсуждение исходный текст
Ответ на BUG #16714: INSERT ON CONFLICT DO UPDATE fails to infer constraint if it's not at top-level partition  (PG Bug reporting form <noreply@postgresql.org>)
Ответы Re: BUG #16714: INSERT ON CONFLICT DO UPDATE fails to infer constraint if it's not at top-level partition  (Andy S <gatekeeper.mail@gmail.com>)
Список pgsql-bugs
PG Bug reporting form <noreply@postgresql.org> writes:
> insert into tbl values (1, 1, 1, 1, 'b') on conflict (part_key4) do update
> set values_columns = excluded.values_columns;
> -- ERROR:  there is no unique or exclusion constraint matching the ON
> CONFLICT specification

I see no bug here.  The partitioned table indeed does not have any
such index.  Moreover, if you had tried to make one, you would have
gotten

ERROR:  unique constraint on partitioned table must include all partitioning columns
DETAIL:  PRIMARY KEY constraint on table "tbl" lacks column "part_key1" which is part of the partition key.

The short answer here is that uniqueness constraints on the individual
partitions are not a substitute for a constraint on the whole partitioned
table.

            regards, tom lane



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

Предыдущее
От: "范孝剑(康贤)"
Дата:
Сообщение: 回复:SnapBuildSerialize function forgot pfree variable ondisk_c
Следующее
От: PG Bug reporting form
Дата:
Сообщение: BUG #16716: postgresql11-devel pckage from Refreshing service 'spacewalk' complains about missing