I tried to debug this, and I see that while the target partition index is correctly
found in ExecInsert(), somehow the resultRelInfo->ri_PartitionCheck is NIL, this
is extracted from array mstate->mt_partitions.
This prevents execution of constraints in following code snippet in ExecInsert():
/*
* Check the constraints of the tuple
*/
if (resultRelationDesc->rd_att->constr || resultRelInfo->ri_PartitionCheck)
ExecConstraints(resultRelInfo, slot, estate);
I couldn't debug it further today.
Regards,
Jeevan Ladhe