Handle INSERT .. ON CONFLICT with partitioned tables
authorAlvaro Herrera <alvherre@alvh.no-ip.org>
Mon, 26 Mar 2018 13:43:54 +0000 (10:43 -0300)
committerAlvaro Herrera <alvherre@alvh.no-ip.org>
Mon, 26 Mar 2018 13:43:54 +0000 (10:43 -0300)
commit555ee77a9668e3f1b03307055b5027e13bf1a715
treee024aef2f35c73208a7e5f11822d89d97548c6c1
parent1b89c2188bd38eac68251f16051859996128f2d0
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
14 files changed:
doc/src/sgml/ddl.sgml
doc/src/sgml/ref/insert.sgml
src/backend/catalog/partition.c
src/backend/executor/execMain.c
src/backend/executor/execPartition.c
src/backend/executor/nodeModifyTable.c
src/backend/parser/analyze.c
src/include/catalog/partition.h
src/include/nodes/execnodes.h
src/include/nodes/nodes.h
src/test/regress/expected/insert_conflict.out
src/test/regress/expected/triggers.out
src/test/regress/sql/insert_conflict.sql
src/test/regress/sql/triggers.sql