diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index f8ee4b0..c5c543f 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -252,8 +252,17 @@ CheckIndexCompatible(Oid oldId,
 	if (!ret)
 		return false;
 
-	/* For polymorphic opcintype, column type changes break compatibility. */
+	/* We now need to actually look at the index rel. */
 	irel = index_open(oldId, AccessShareLock);	/* caller probably has a lock */
+
+	/* If it's a partitioned index, there is no storage to share. */
+	if (irel->rd_rel->relkind == RELKIND_PARTITIONED_INDEX)
+	{
+		index_close(irel, NoLock);
+		return false;
+	}
+
+	/* For polymorphic opcintype, column type changes break compatibility. */
 	for (i = 0; i < old_natts; i++)
 	{
 		if (IsPolymorphicType(get_opclass_input_type(classObjectId[i])) &&
