*** a/src/backend/commands/copy.c
--- b/src/backend/commands/copy.c
***************
*** 2709,2715 **** CopyFrom(CopyState cstate)
  					check_partition_constr = false;
  
  				/* Check the constraints of the tuple */
! 				if (cstate->rel->rd_att->constr || check_partition_constr)
  					ExecConstraints(resultRelInfo, slot, estate, true);
  
  				if (useHeapMultiInsert)
--- 2709,2716 ----
  					check_partition_constr = false;
  
  				/* Check the constraints of the tuple */
! 				if (resultRelInfo->ri_RelationDesc->rd_att->constr ||
! 					check_partition_constr)
  					ExecConstraints(resultRelInfo, slot, estate, true);
  
  				if (useHeapMultiInsert)
