Handle INSERT .. ON CONFLICT with partitioned tables
Alvaro Herrera <alvherre@alvh.no-ip.org>
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
Files
| Path | Change | +/− |
|---|---|---|
| doc/src/sgml/ddl.sgml | modified | +0 −15 |
| doc/src/sgml/ref/insert.sgml | modified | +8 −0 |
| src/backend/catalog/partition.c | modified | +77 −11 |
| src/backend/executor/execMain.c | modified | +4 −0 |
| src/backend/executor/execPartition.c | modified | +219 −14 |
| src/backend/executor/nodeModifyTable.c | modified | +62 −12 |
| src/backend/parser/analyze.c | modified | +0 −7 |
| src/include/catalog/partition.h | modified | +1 −0 |
| src/include/nodes/execnodes.h | modified | +18 −4 |
| src/include/nodes/nodes.h | modified | +1 −0 |
| src/test/regress/expected/insert_conflict.out | modified | +97 −11 |
| src/test/regress/expected/triggers.out | modified | +33 −0 |
| src/test/regress/sql/insert_conflict.sql | modified | +85 −10 |
| src/test/regress/sql/triggers.sql | modified | +33 −0 |
Documentation touched
Discussion
- ON CONFLICT DO UPDATE for partitioned tables 53 messages · 2018-02-28 → 2018-04-20