mirror of
https://github.com/postgres/postgres.git
synced 2025-10-25 13:17:41 +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:
@@ -1347,11 +1347,15 @@ InitResultRelInfo(ResultRelInfo *resultRelInfo,
|
||||
resultRelInfo->ri_FdwRoutine = GetFdwRoutineForRelation(resultRelationDesc, true);
|
||||
else
|
||||
resultRelInfo->ri_FdwRoutine = NULL;
|
||||
|
||||
/* The following fields are set later if needed */
|
||||
resultRelInfo->ri_FdwState = NULL;
|
||||
resultRelInfo->ri_usesFdwDirectModify = false;
|
||||
resultRelInfo->ri_ConstraintExprs = NULL;
|
||||
resultRelInfo->ri_junkFilter = NULL;
|
||||
resultRelInfo->ri_projectReturning = NULL;
|
||||
resultRelInfo->ri_onConflictArbiterIndexes = NIL;
|
||||
resultRelInfo->ri_onConflict = NULL;
|
||||
|
||||
/*
|
||||
* Partition constraint, which also includes the partition constraint of
|
||||
|
||||
Reference in New Issue
Block a user