diff --git a/src/backend/parser/parse_node.c b/src/backend/parser/parse_node.c
index 6ffbd76..cba1a19 100644
*** a/src/backend/parser/parse_node.c
--- b/src/backend/parser/parse_node.c
*************** transformArrayType(Oid *arrayType, int32
*** 226,231 ****
--- 226,242 ----
  	 */
  	*arrayType = getBaseTypeAndTypmod(*arrayType, arrayTypmod);
  
+ 	/*
+ 	 * We treat int2vector and oidvector as though they were domains over
+ 	 * regular int2[] and oid[].  This is because array slicing could create
+ 	 * an array that doesn't necessarily satisfy the dimensionality
+ 	 * constraints of those types.
+ 	 */
+ 	if (*arrayType == INT2VECTOROID)
+ 		*arrayType = 1005;
+ 	else if (*arrayType == OIDVECTOROID)
+ 		*arrayType = 1028;
+ 
  	/* Get the type tuple for the array */
  	type_tuple_array = SearchSysCache1(TYPEOID, ObjectIdGetDatum(*arrayType));
  	if (!HeapTupleIsValid(type_tuple_array))
diff --git a/src/backend/parser/parse_target.c b/src/backend/parser/parse_target.c
index 9c6c202..24bb090 100644
*** a/src/backend/parser/parse_target.c
--- b/src/backend/parser/parse_target.c
*************** transformAssignmentSubscripts(ParseState
*** 839,846 ****
  	/* If target was a domain over array, need to coerce up to the domain */
  	if (arrayType != targetTypeId)
  	{
  		result = coerce_to_target_type(pstate,
! 									   result, exprType(result),
  									   targetTypeId, targetTypMod,
  									   COERCION_ASSIGNMENT,
  									   COERCE_IMPLICIT_CAST,
--- 839,848 ----
  	/* If target was a domain over array, need to coerce up to the domain */
  	if (arrayType != targetTypeId)
  	{
+ 		Oid		resulttype = exprType(result);
+ 
  		result = coerce_to_target_type(pstate,
! 									   result, resulttype,
  									   targetTypeId, targetTypMod,
  									   COERCION_ASSIGNMENT,
  									   COERCE_IMPLICIT_CAST,
*************** transformAssignmentSubscripts(ParseState
*** 850,856 ****
  			ereport(ERROR,
  					(errcode(ERRCODE_CANNOT_COERCE),
  					 errmsg("cannot cast type %s to %s",
! 							format_type_be(exprType(result)),
  							format_type_be(targetTypeId)),
  					 parser_errposition(pstate, location)));
  	}
--- 852,858 ----
  			ereport(ERROR,
  					(errcode(ERRCODE_CANNOT_COERCE),
  					 errmsg("cannot cast type %s to %s",
! 							format_type_be(resulttype),
  							format_type_be(targetTypeId)),
  					 parser_errposition(pstate, location)));
  	}
