diff --git a/src/backend/access/common/tupconvert.c b/src/backend/access/common/tupconvert.c index 34e5f114404..f25cd860f3f 100644 --- a/src/backend/access/common/tupconvert.c +++ b/src/backend/access/common/tupconvert.c @@ -100,7 +100,8 @@ convert_tuples_by_position(TupleDesc indesc, nincols++; /* Found matching column, check type */ if (atttypid != att->atttypid || - (atttypmod != att->atttypmod && atttypmod >= 0)) + (atttypmod != att->atttypmod && atttypmod >= 0 && + att->atttypmod >= 0)) ereport(ERROR, (errcode(ERRCODE_DATATYPE_MISMATCH), errmsg_internal("%s", _(msg)),