Add missing error code to "cannot attach index ..." error.

ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE was used in an ereport with the
same message but different errdetail a few lines earlier, so use that
here as well.

Backpatch-through: 11
This commit is contained in:
Heikki Linnakangas 2020-05-28 12:37:00 +03:00
parent 0099db4ce1
commit 5b1c61e8b8
1 changed files with 2 additions and 1 deletions

View 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\".",