Skip to content

Commit e449d9b

Browse files
jianhe-funCommitfest Bot
authored andcommitted
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 45e7e8c commit e449d9b

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
@@ -21707,7 +21707,8 @@ refuseDupeIndexAttach(Relation parentIdx, Relation partIdx, Relation partitionTb
2170721707
errmsg("cannot attach index \"%s\" as a partition of index \"%s\"",
2170821708
RelationGetRelationName(partIdx),
2170921709
RelationGetRelationName(parentIdx)),
21710-
errdetail("Another index is already attached for partition \"%s\".",
21710+
errdetail("Another index \"%s\" is already attached for partition \"%s\".",
21711+
get_rel_name(existingIdx),
2171121712
RelationGetRelationName(partitionTbl))));
2171221713
}
2171321714

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)