mirror of
https://github.com/postgres/postgres.git
synced 2025-10-16 17:07:43 +03:00
Minor error message enhancement
In refuseDupeIndexAttach(), change from errdetail("Another index is already attached for partition \"%s\"."...) to errdetail("Another index \"%s\" is already attached for partition \"%s\"."...) so we can easily understand which index is already attached for partition \"%s\". Author: Jian He <jian.universality@gmail.com> Reviewed-by: Daniel Gustafsson <daniel@yesql.se> Reviewed-by: Peter Eisentraut <peter@eisentraut.org> Discussion: https://www.postgresql.org/message-id/flat/CACJufxGBfykJ_1ztk9T%2BL_gLmkOSOF%2BmL9Mn4ZPydz-rh%3DLccQ%40mail.gmail.com
This commit is contained in:
@@ -21750,7 +21750,8 @@ refuseDupeIndexAttach(Relation parentIdx, Relation partIdx, Relation partitionTb
|
||||
errmsg("cannot attach index \"%s\" as a partition of index \"%s\"",
|
||||
RelationGetRelationName(partIdx),
|
||||
RelationGetRelationName(parentIdx)),
|
||||
errdetail("Another index is already attached for partition \"%s\".",
|
||||
errdetail("Another index \"%s\" is already attached for partition \"%s\".",
|
||||
get_rel_name(existingIdx),
|
||||
RelationGetRelationName(partitionTbl))));
|
||||
}
|
||||
|
||||
|
@@ -248,7 +248,7 @@ alter index idxpart_a_b_idx attach partition idxpart1_a_b_idx; -- quiet
|
||||
create index idxpart1_2_a_b on idxpart1 (a, b);
|
||||
alter index idxpart_a_b_idx attach partition idxpart1_2_a_b;
|
||||
ERROR: cannot attach index "idxpart1_2_a_b" as a partition of index "idxpart_a_b_idx"
|
||||
DETAIL: Another index is already attached for partition "idxpart1".
|
||||
DETAIL: Another index "idxpart1_a_b_idx" is already attached for partition "idxpart1".
|
||||
drop table idxpart;
|
||||
-- make sure everything's gone
|
||||
select indexrelid::regclass, indrelid::regclass
|
||||
|
Reference in New Issue
Block a user