diff options
| author | Heikki Linnakangas | 2020-05-28 09:37:00 +0000 |
|---|---|---|
| committer | Heikki Linnakangas | 2020-05-28 09:37:56 +0000 |
| commit | 34301c9c5674919ef2e786f1157b3ced543b02e2 (patch) | |
| tree | 9661e552f0cc39b64fb01b9a2890a5e727af3039 | |
| parent | 25fc24ba90df99d3c331627f3e4efb795a440dd0 (diff) | |
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
| -rw-r--r-- | src/backend/commands/tablecmds.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/backend/commands/tablecmds.c b/src/backend/commands/tablecmds.c index bc66d6c4f5f..4c6692e1ab8 100644 --- a/src/backend/commands/tablecmds.c +++ b/src/backend/commands/tablecmds.c @@ -15977,7 +15977,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\".", |
