Avoid splitting errmsg string to span multiple lines
The error message being fixed was added in 6185c9737c. 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
This commit is contained in:
parent
7e65ad197f
commit
085e759e9d
@ -4586,9 +4586,7 @@ transformJsonBehavior(ParseState *pstate, JsonBehavior *behavior,
|
|||||||
!IsA(expr, OpExpr))
|
!IsA(expr, OpExpr))
|
||||||
ereport(ERROR,
|
ereport(ERROR,
|
||||||
(errcode(ERRCODE_DATATYPE_MISMATCH),
|
(errcode(ERRCODE_DATATYPE_MISMATCH),
|
||||||
errmsg("can only specify constant, non-aggregate"
|
errmsg("can only specify a constant, non-aggregate function, or operator expression for DEFAULT"),
|
||||||
" function, or operator expression for"
|
|
||||||
" DEFAULT"),
|
|
||||||
parser_errposition(pstate, exprLocation(expr))));
|
parser_errposition(pstate, exprLocation(expr))));
|
||||||
if (contain_var_clause(expr))
|
if (contain_var_clause(expr))
|
||||||
ereport(ERROR,
|
ereport(ERROR,
|
||||||
|
@ -1203,11 +1203,11 @@ ERROR: DEFAULT expression must not contain column references
|
|||||||
LINE 1: SELECT JSON_QUERY(js, '$' RETURNING int DEFAULT b + 1 ON ER...
|
LINE 1: SELECT JSON_QUERY(js, '$' RETURNING int DEFAULT b + 1 ON ER...
|
||||||
^
|
^
|
||||||
SELECT JSON_QUERY(js, '$' RETURNING int DEFAULT sum(1) over() ON ERROR) FROM test_jsonb_mutability;
|
SELECT JSON_QUERY(js, '$' RETURNING int DEFAULT sum(1) over() ON ERROR) FROM test_jsonb_mutability;
|
||||||
ERROR: can only specify constant, non-aggregate function, or operator expression for DEFAULT
|
ERROR: can only specify a constant, non-aggregate function, or operator expression for DEFAULT
|
||||||
LINE 1: SELECT JSON_QUERY(js, '$' RETURNING int DEFAULT sum(1) over...
|
LINE 1: SELECT JSON_QUERY(js, '$' RETURNING int DEFAULT sum(1) over...
|
||||||
^
|
^
|
||||||
SELECT JSON_QUERY(js, '$' RETURNING int DEFAULT (SELECT 1) ON ERROR) FROM test_jsonb_mutability;
|
SELECT JSON_QUERY(js, '$' RETURNING int DEFAULT (SELECT 1) ON ERROR) FROM test_jsonb_mutability;
|
||||||
ERROR: can only specify constant, non-aggregate function, or operator expression for DEFAULT
|
ERROR: can only specify a constant, non-aggregate function, or operator expression for DEFAULT
|
||||||
LINE 1: SELECT JSON_QUERY(js, '$' RETURNING int DEFAULT (SELECT 1) ...
|
LINE 1: SELECT JSON_QUERY(js, '$' RETURNING int DEFAULT (SELECT 1) ...
|
||||||
^
|
^
|
||||||
DROP TABLE test_jsonb_mutability;
|
DROP TABLE test_jsonb_mutability;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user