Handle INSERT .. ON CONFLICT with partitioned tables
Commit eb7ed3f30634 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
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/555ee77a9668e3f1b03307055b5027e13bf1a715
Modified Files
--------------
doc/src/sgml/ddl.sgml | 15 --
doc/src/sgml/ref/insert.sgml | 8 +
src/backend/catalog/partition.c | 88 ++++++++--
src/backend/executor/execMain.c | 4 +
src/backend/executor/execPartition.c | 233 ++++++++++++++++++++++++--
src/backend/executor/nodeModifyTable.c | 74 ++++++--
src/backend/parser/analyze.c | 7 -
src/include/catalog/partition.h | 1 +
src/include/nodes/execnodes.h | 22 ++-
src/include/nodes/nodes.h | 1 +
src/test/regress/expected/insert_conflict.out | 108 ++++++++++--
src/test/regress/expected/triggers.out | 33 ++++
src/test/regress/sql/insert_conflict.sql | 95 +++++++++--
src/test/regress/sql/triggers.sql | 33 ++++
14 files changed, 638 insertions(+), 84 deletions(-)