mirror of
https://github.com/postgres/postgres.git
synced 2025-11-06 07:49:08 +03:00
Handle INSERT .. ON CONFLICT with partitioned tables
Commit eb7ed3f306 enabled unique constraints on partitioned tables,
but one thing that was not working properly is INSERT/ON CONFLICT.
This commit introduces a new node keeps state related to the ON CONFLICT
clause per partition, and fills it when that partition is about to be
used for tuple routing.
Author: Amit Langote, Álvaro Herrera
Reviewed-by: Etsuro Fujita, Pavan Deolasee
Discussion: https://postgr.es/m/20180228004602.cwdyralmg5ejdqkq@alvherre.pgsql
This commit is contained in:
@@ -518,6 +518,14 @@ INSERT INTO <replaceable class="parameter">table_name</replaceable> [ AS <replac
|
||||
not duplicate each other in terms of attributes constrained by an
|
||||
arbiter index or constraint.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Note that it is currently not supported for the
|
||||
<literal>ON CONFLICT DO UPDATE</literal> clause of an
|
||||
<command>INSERT</command> applied to a partitioned table to update the
|
||||
partition key of a conflicting row such that it requires the row be moved
|
||||
to a new partition.
|
||||
</para>
|
||||
<tip>
|
||||
<para>
|
||||
It is often preferable to use unique index inference rather than
|
||||
|
||||
Reference in New Issue
Block a user