git.postgresql.org Git - postgresql.git/commitdiff

git projects / postgresql.git / commitdiff
? search:
summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 0099db4)
Add missing error code to "cannot attach index ..." error.
2020年5月28日 09:37:00 +0000 (12:37 +0300)
2020年5月28日 09:37:00 +0000 (12:37 +0300)
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


diff --git a/src/backend/commands/tablecmds.c b/src/backend/commands/tablecmds.c
index 8801af589cf351326ce7d2607524ddb3f385f171..2ab02e01a0285b5677b5eb05091ad9ab1ddd6227 100644 (file)
--- 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\".",
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /