Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit02a5786

Browse files
committed
Improve error reporting in opclasscmds.c
This commit improves error reporting introduced by911e702. It putsargument of errmsg() to the single line for easier grepping source for errortext. Also it improves wording of errhint().
1 parent087d3d0 commit02a5786

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

‎src/backend/commands/opclasscmds.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1156,16 +1156,14 @@ assignProcTypes(OpFamilyMember *member, Oid amoid, Oid typeoid,
11561156
(OidIsValid(member->righttype)&&member->righttype!=typeoid))
11571157
ereport(ERROR,
11581158
(errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
1159-
errmsg("associated data types for opclass options "
1160-
"parsing functions must match opclass input type")));
1159+
errmsg("associated data types for opclass options parsing functions must match opclass input type")));
11611160
}
11621161
else
11631162
{
11641163
if (member->lefttype!=member->righttype)
11651164
ereport(ERROR,
11661165
(errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
1167-
errmsg("left and right associated data types for "
1168-
"opclass options parsing functions must match")));
1166+
errmsg("left and right associated data types for opclass options parsing functions must match")));
11691167
}
11701168

11711169
if (procform->prorettype!=VOIDOID||
@@ -1174,9 +1172,10 @@ assignProcTypes(OpFamilyMember *member, Oid amoid, Oid typeoid,
11741172
ereport(ERROR,
11751173
(errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
11761174
errmsg("invalid opclass options parsing function"),
1177-
errhint("opclass options parsing functionmust have signature'%s'",
1175+
errhint("Valid signature ofopclass options parsing functionis'%s'.",
11781176
"(internal) RETURNS void")));
11791177
}
1178+
11801179
/*
11811180
* btree comparison procs must be 2-arg procs returning int4. btree
11821181
* sortsupport procs must take internal and return void. btree in_range

‎src/test/regress/expected/alter_generic.out

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -506,7 +506,7 @@ ALTER OPERATOR FAMILY alt_opf19 USING btree ADD FUNCTION 5 test_opclass_options_
506506
ERROR: function test_opclass_options_func(internal, text[], boolean) does not exist
507507
ALTER OPERATOR FAMILY alt_opf19 USING btree ADD FUNCTION 5 (int4) btint42cmp(int4, int2);
508508
ERROR: invalid opclass options parsing function
509-
HINT: opclass options parsing functionmust have signature'(internal) RETURNS void'
509+
HINT:Valid signature ofopclass options parsing functionis'(internal) RETURNS void'.
510510
ALTER OPERATOR FAMILY alt_opf19 USING btree ADD FUNCTION 5 (int4, int2) btint42cmp(int4, int2);
511511
ERROR: left and right associated data types for opclass options parsing functions must match
512512
ALTER OPERATOR FAMILY alt_opf19 USING btree ADD FUNCTION 5 (int4) test_opclass_options_func(internal); -- Ok

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp