mirror of
https://github.com/postgres/postgres.git
synced 2025-06-27 23:21:58 +03:00
Factor error generation out of ExecPartitionCheck.
At present, we always raise an ERROR if the partition constraint is violated, but a pending patch for UPDATE tuple routing will consider instead moving the tuple to the correct partition. Refactor to make that simpler. Amit Khandekar, reviewed by Amit Langote, David Rowley, and me. Discussion: http://postgr.es/m/CAJ3gD9cue54GbEzfV-61nyGpijvjZgCcghvLsB0_nL8Nm8HzCA@mail.gmail.com
This commit is contained in:
@ -487,7 +487,7 @@ ExecInsert(ModifyTableState *mtstate,
|
||||
|
||||
/* Check the constraints of the tuple */
|
||||
if (resultRelationDesc->rd_att->constr || check_partition_constr)
|
||||
ExecConstraints(resultRelInfo, slot, estate);
|
||||
ExecConstraints(resultRelInfo, slot, estate, true);
|
||||
|
||||
if (onconflict != ONCONFLICT_NONE && resultRelInfo->ri_NumIndices > 0)
|
||||
{
|
||||
@ -1049,7 +1049,7 @@ lreplace:;
|
||||
* tuple-routing is performed here, hence the slot remains unchanged.
|
||||
*/
|
||||
if (resultRelationDesc->rd_att->constr || resultRelInfo->ri_PartitionCheck)
|
||||
ExecConstraints(resultRelInfo, slot, estate);
|
||||
ExecConstraints(resultRelInfo, slot, estate, true);
|
||||
|
||||
/*
|
||||
* replace the heap tuple
|
||||
|
Reference in New Issue
Block a user