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