index 8801af589cf351326ce7d2607524ddb3f385f171..2ab02e01a0285b5677b5eb05091ad9ab1ddd6227 100644 (file)
@@ -17191,7 +17191,8 @@ ATExecAttachPartitionIdx(List **wqueue, Relation parentIdx, RangeVar *name)
}
if (!found)
ereport(ERROR,
- (errmsg("cannot attach index \"%s\" as a partition of index \"%s\"",
+ (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot attach index \"%s\" as a partition of index \"%s\"",
RelationGetRelationName(partIdx),
RelationGetRelationName(parentIdx)),
errdetail("Index \"%s\" is not an index on any partition of table \"%s\".",