Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 085e759

Browse 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

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

src/backend/parser/parse_expr.c

+1-3
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

+2-2
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)