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

Appearance settings

Commit 085e759

Browse filesBrowse files
committed
Avoid splitting errmsg string to span multiple lines
The error message being fixed was added in 6185c97. While at it, add an "a" to the sentence. Reported-by: Kyotaro Horiguchi <horikyota.ntt@gmail.com> Discussion: https://postgr.es/m/20240322.095149.895185546948714852.horikyota.ntt%40gmail.com
1 parent 7e65ad1 commit 085e759
Copy full SHA for 085e759

File tree

Expand file treeCollapse file tree

2 files changed

+3
-5
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+3
-5
lines changed

‎src/backend/parser/parse_expr.c

Copy file name to clipboardExpand all lines: src/backend/parser/parse_expr.c
+1-3Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4586,9 +4586,7 @@ transformJsonBehavior(ParseState *pstate, JsonBehavior *behavior,
45864586
!IsA(expr, OpExpr))
45874587
ereport(ERROR,
45884588
(errcode(ERRCODE_DATATYPE_MISMATCH),
4589-
errmsg("can only specify constant, non-aggregate"
4590-
" function, or operator expression for"
4591-
" DEFAULT"),
4589+
errmsg("can only specify a constant, non-aggregate function, or operator expression for DEFAULT"),
45924590
parser_errposition(pstate, exprLocation(expr))));
45934591
if (contain_var_clause(expr))
45944592
ereport(ERROR,

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

Copy file name to clipboardExpand all lines: src/test/regress/expected/sqljson_queryfuncs.out
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1203,11 +1203,11 @@ ERROR: DEFAULT expression must not contain column references
12031203
LINE 1: SELECT JSON_QUERY(js, '$' RETURNING int DEFAULT b + 1 ON ER...
12041204
^
12051205
SELECT JSON_QUERY(js, '$' RETURNING int DEFAULT sum(1) over() ON ERROR) FROM test_jsonb_mutability;
1206-
ERROR: can only specify constant, non-aggregate function, or operator expression for DEFAULT
1206+
ERROR: can only specify a constant, non-aggregate function, or operator expression for DEFAULT
12071207
LINE 1: SELECT JSON_QUERY(js, '$' RETURNING int DEFAULT sum(1) over...
12081208
^
12091209
SELECT JSON_QUERY(js, '$' RETURNING int DEFAULT (SELECT 1) ON ERROR) FROM test_jsonb_mutability;
1210-
ERROR: can only specify constant, non-aggregate function, or operator expression for DEFAULT
1210+
ERROR: can only specify a constant, non-aggregate function, or operator expression for DEFAULT
12111211
LINE 1: SELECT JSON_QUERY(js, '$' RETURNING int DEFAULT (SELECT 1) ...
12121212
^
12131213
DROP TABLE test_jsonb_mutability;

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.