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

Commitd4feade

Browse files
committed
Add error position to an error message
Reviewed-by: Pavel Stehule <pavel.stehule@gmail.com>Discussion:https://www.postgresql.org/message-id/flat/6e7aa4a1-be6a-1a75-b1f9-83a678e5184a@2ndquadrant.com
1 parentc60e520 commitd4feade

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

‎src/backend/commands/prepare.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,8 @@ EvaluateParams(PreparedStatement *pstmt, List *params,
381381
i+1,
382382
format_type_be(given_type_id),
383383
format_type_be(expected_type_id)),
384-
errhint("You will need to rewrite or cast the expression.")));
384+
errhint("You will need to rewrite or cast the expression."),
385+
parser_errposition(pstate,exprLocation(lfirst(l)))));
385386

386387
/* Take care of collations in the finished expression. */
387388
assign_expr_collations(pstate,expr);

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,8 @@ DETAIL: Expected 5 parameters but got 6.
113113
-- wrong param types
114114
EXECUTE q3(5::smallint, 10.5::float, false, 4::bigint, 'bytea');
115115
ERROR: parameter $3 of type boolean cannot be coerced to the expected type double precision
116+
LINE 1: EXECUTE q3(5::smallint, 10.5::float, false, 4::bigint, 'byte...
117+
^
116118
HINT: You will need to rewrite or cast the expression.
117119
-- invalid type
118120
PREPARE q4(nonexistenttype) AS SELECT $1;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp