aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>2020-05-28 12:37:00 +0300
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>2020-05-28 12:37:00 +0300
commit5b1c61e8b8f98f4a1c42856819b6dea600669f47 (patch)
treedd89d482ef8882a355116c17b9d79f7d39606358 /src
parent0099db4ce1a19038d0d837bf82a35c989332cc58 (diff)
downloadpostgresql-5b1c61e8b8f98f4a1c42856819b6dea600669f47.tar.gz
postgresql-5b1c61e8b8f98f4a1c42856819b6dea600669f47.zip
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
Diffstat (limited to 'src')
-rw-r--r--src/backend/commands/tablecmds.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/backend/commands/tablecmds.c b/src/backend/commands/tablecmds.c
index 8801af589cf..2ab02e01a02 100644
--- a/src/backend/commands/tablecmds.c
+++ b/src/backend/commands/tablecmds.c
@@ -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\".",