Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 83d0e2a

Browse files
jianhe-funCommitfest Bot
authored and
Commitfest Bot
committed
minor error message enhancement
in refuseDupeIndexAttach change it 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\". discussion: https://postgr.es/m/
1 parent e050af2 commit 83d0e2a

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/backend/commands/tablecmds.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21702,7 +21702,8 @@ refuseDupeIndexAttach(Relation parentIdx, Relation partIdx, Relation partitionTb
2170221702
errmsg("cannot attach index \"%s\" as a partition of index \"%s\"",
2170321703
RelationGetRelationName(partIdx),
2170421704
RelationGetRelationName(parentIdx)),
21705-
errdetail("Another index is already attached for partition \"%s\".",
21705+
errdetail("Another index \"%s\" is already attached for partition \"%s\".",
21706+
get_rel_name(existingIdx),
2170621707
RelationGetRelationName(partitionTbl))));
2170721708
}
2170821709

src/test/regress/expected/indexing.out

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ alter index idxpart_a_b_idx attach partition idxpart1_a_b_idx; -- quiet
248248
create index idxpart1_2_a_b on idxpart1 (a, b);
249249
alter index idxpart_a_b_idx attach partition idxpart1_2_a_b;
250250
ERROR: cannot attach index "idxpart1_2_a_b" as a partition of index "idxpart_a_b_idx"
251-
DETAIL: Another index is already attached for partition "idxpart1".
251+
DETAIL: Another index "idxpart1_a_b_idx" is already attached for partition "idxpart1".
252252
drop table idxpart;
253253
-- make sure everything's gone
254254
select indexrelid::regclass, indrelid::regclass

0 commit comments

Comments
 (0)