aboutsummaryrefslogtreecommitdiff
path: root/src/backend/commands/tablecmds.c
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:45 +0300
commit7b009944c2525fcf8ee35db135c4bc560eb208f2 (patch)
treeb090903ea116094b619c2211ac0cfc5bec25d403 /src/backend/commands/tablecmds.c
parent169a6588a71724e7932ece91d844b810b0dbed67 (diff)
downloadpostgresql-7b009944c2525fcf8ee35db135c4bc560eb208f2.tar.gz
postgresql-7b009944c2525fcf8ee35db135c4bc560eb208f2.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/backend/commands/tablecmds.c')
-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 2a15e07ede7..3b8a2199e59 100644
--- a/src/backend/commands/tablecmds.c
+++ b/src/backend/commands/tablecmds.c
@@ -16832,7 +16832,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\".",