BUG #16714: INSERT ON CONFLICT DO UPDATE fails to infer constraint if it's not at top-level partition
| От | PG Bug reporting form |
|---|---|
| Тема | BUG #16714: INSERT ON CONFLICT DO UPDATE fails to infer constraint if it's not at top-level partition |
| Дата | |
| Msg-id | 16714-dbf5759eba70bfe4@postgresql.org обсуждение исходный текст |
| Ответы |
Re: BUG #16714: INSERT ON CONFLICT DO UPDATE fails to infer constraint if it's not at top-level partition
|
| Список | pgsql-bugs |
The following bug has been logged on the website:
Bug reference: 16714
Logged by: Andy S
Email address: gatekeeper.mail@gmail.com
PostgreSQL version: 11.2
Operating system: Gentoo Linux
Description:
create table tbl (
part_key1 int,
part_key2 int,
part_key3 int,
part_key4 int,
values_columns varchar
) partition by list(part_key1);
create table tbl_p1 partition of tbl for values in (1) partition by
list(part_key2);
create table tbl_p1_p2 partition of tbl_p1 for values in (1) partition by
range (part_key3);
create table tbl_p1_p2_p3 partition of tbl_p1_p2 for values from (0) to
(100) partition by HASH(part_key4);
create table tbl_p1_p2_p3_p4_0 partition of tbl_p1_p2_p3 (constraint
tbl_p1_p2_p3_0_pkey primary key (part_key4)) for values with (modulus 4,
remainder 0);
create table tbl_p1_p2_p3_p4_1 partition of tbl_p1_p2_p3 (constraint
tbl_p1_p2_p3_1_pkey primary key (part_key4)) for values with (modulus 4,
remainder 1);
create table tbl_p1_p2_p3_p4_2 partition of tbl_p1_p2_p3 (constraint
tbl_p1_p2_p3_2_pkey primary key (part_key4)) for values with (modulus 4,
remainder 2);
create table tbl_p1_p2_p3_p4_3 partition of tbl_p1_p2_p3 (constraint
tbl_p1_p2_p3_3_pkey primary key (part_key4)) for values with (modulus 4,
remainder 3);
insert into tbl values (1, 1, 1, 1, 'a');
insert into tbl values (1, 1, 1, 1, 'b');
-- ERROR: duplicate key value violates unique constraint
"tbl_p1_p2_p3_0_pkey"
-- DETAIL: Key (part_key4)=(1) already exists.
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
В списке pgsql-bugs по дате отправления: