Commit 5b1c61e8 authored by Heikki Linnakangas's avatar Heikki Linnakangas

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
parent 0099db4c
...@@ -17191,7 +17191,8 @@ ATExecAttachPartitionIdx(List **wqueue, Relation parentIdx, RangeVar *name) ...@@ -17191,7 +17191,8 @@ ATExecAttachPartitionIdx(List **wqueue, Relation parentIdx, RangeVar *name)
} }
if (!found) if (!found)
ereport(ERROR, 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(partIdx),
RelationGetRelationName(parentIdx)), RelationGetRelationName(parentIdx)),
errdetail("Index \"%s\" is not an index on any partition of table \"%s\".", errdetail("Index \"%s\" is not an index on any partition of table \"%s\".",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment