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

Commit237a0b8

Browse files
committed
Improve plural handling in error message
This does not use the normal plural handling, because no numbers appearin the actual message.
1 parent85f4d63 commit237a0b8

File tree

8 files changed

+11
-8
lines changed

8 files changed

+11
-8
lines changed

‎src/backend/parser/parse_oper.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -723,7 +723,10 @@ op_error(ParseState *pstate, List *op, char oprkind,
723723
(errcode(ERRCODE_UNDEFINED_FUNCTION),
724724
errmsg("operator does not exist: %s",
725725
op_signature_string(op,oprkind,arg1,arg2)),
726-
errhint("No operator matches the given name and argument type(s). "
726+
(!arg1|| !arg2) ?
727+
errhint("No operator matches the given name and argument type. "
728+
"You might need to add an explicit type cast.") :
729+
errhint("No operator matches the given name and argument types. "
727730
"You might need to add explicit type casts."),
728731
parser_errposition(pstate,location)));
729732
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1895,7 +1895,7 @@ alter table anothertab alter column atcol1 drop default;
18951895
alter table anothertab alter column atcol1 type boolean
18961896
using case when atcol1 % 2 = 0 then true else false end; -- fails
18971897
ERROR: operator does not exist: boolean <= integer
1898-
HINT: No operator matches the given name and argumenttype(s). You might need to add explicit type casts.
1898+
HINT: No operator matches the given name and argumenttypes. You might need to add explicit type casts.
18991899
alter table anothertab drop constraint anothertab_chk;
19001900
alter table anothertab drop constraint anothertab_chk; -- fails
19011901
ERROR: constraint "anothertab_chk" of relation "anothertab" does not exist

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1605,7 +1605,7 @@ select 'foo'::text = any((select array['abc','def','foo']::text[])); -- fail
16051605
ERROR: operator does not exist: text = text[]
16061606
LINE 1: select 'foo'::text = any((select array['abc','def','foo']::t...
16071607
^
1608-
HINT: No operator matches the given name and argumenttype(s). You might need to add explicit type casts.
1608+
HINT: No operator matches the given name and argumenttypes. You might need to add explicit type casts.
16091609
select 'foo'::text = any((select array['abc','def','foo']::text[])::text[]);
16101610
?column?
16111611
----------

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ SELECT '' AS count, p.f1, l.s, l.s # p.f1 AS intersection
107107
ERROR: operator does not exist: lseg # point
108108
LINE 1: SELECT '' AS count, p.f1, l.s, l.s # p.f1 AS intersection
109109
^
110-
HINT: No operator matches the given name and argumenttype(s). You might need to add explicit type casts.
110+
HINT: No operator matches the given name and argumenttypes. You might need to add explicit type casts.
111111
-- closest point
112112
SELECT '' AS thirty, p.f1, l.s, p.f1 ## l.s AS closest
113113
FROM LSEG_TBL l, POINT_TBL p;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ SELECT date '1991-02-03' - time with time zone '04:05:06 UTC' AS "Subtract Time
321321
ERROR: operator does not exist: date - time with time zone
322322
LINE 1: SELECT date '1991-02-03' - time with time zone '04:05:06 UTC...
323323
^
324-
HINT: No operator matches the given name and argumenttype(s). You might need to add explicit type casts.
324+
HINT: No operator matches the given name and argumenttypes. You might need to add explicit type casts.
325325
--
326326
-- timestamp, interval arithmetic
327327
--

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ select 3 || 4.0;
5050
ERROR: operator does not exist: integer || numeric
5151
LINE 1: select 3 || 4.0;
5252
^
53-
HINT: No operator matches the given name and argumenttype(s). You might need to add explicit type casts.
53+
HINT: No operator matches the given name and argumenttypes. You might need to add explicit type casts.
5454
/*
5555
* various string functions
5656
*/

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,4 +92,4 @@ SELECT f1 + time with time zone '00:01' AS "Illegal" FROM TIMETZ_TBL;
9292
ERROR: operator does not exist: time with time zone + time with time zone
9393
LINE 1: SELECT f1 + time with time zone '00:01' AS "Illegal" FROM TI...
9494
^
95-
HINT: No operator matches the given name and argumenttype(s). You might need to add explicit type casts.
95+
HINT: No operator matches the given name and argumenttypes. You might need to add explicit type casts.

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ SELECT n, n IS OF (int) AS is_int FROM t;
166166
ERROR: operator does not exist: text + integer
167167
LINE 4: SELECT n+1 FROM t WHERE n < 10
168168
^
169-
HINT: No operator matches the given name and argumenttype(s). You might need to add explicit type casts.
169+
HINT: No operator matches the given name and argumenttypes. You might need to add explicit type casts.
170170
--
171171
-- Some examples with a tree
172172
--

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp