fix upsert core and cross-partition upsert

This commit is contained in:
gentle_hu
2021-07-06 14:13:00 +08:00
parent d9dc69168f
commit 4d2c0d708e
14 changed files with 48 additions and 6 deletions

View File

@ -1304,6 +1304,11 @@ bool ExecCheckIndexConstraints(TupleTableSlot* slot, EState* estate,
ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
errmsg("INSERT ON DUPLICATE KEY UPDATE does not support deferrable"
" unique constraints/exclusion constraints.")));
/*
* We consider a partitioned table with a global index as a normal table,
* because conflicts can be between multiple partitions.
*/
if (isPartitioned && !RelationIsGlobalIndex(indexRelation)) {
partitionedindexid = RelationGetRelid(indexRelation);
if (!PointerIsValid(partitionIndexOidList)) {