Improve a couple of sql/json error messages
Fix the grammar in two, and add a hint to one.
This commit is contained in:
parent
fcdb35c32a
commit
4cd8717af3
@ -4456,7 +4456,7 @@ transformJsonFuncExpr(ParseState *pstate, JsonFuncExpr *func)
|
|||||||
if (jsexpr->returning->typid != JSONBOID)
|
if (jsexpr->returning->typid != JSONBOID)
|
||||||
ereport(ERROR,
|
ereport(ERROR,
|
||||||
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
|
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
|
||||||
errmsg("JSON_TABLE() is not yet implemented for json type"),
|
errmsg("JSON_TABLE() is not yet implemented for the json type"),
|
||||||
errhint("Try casting the argument to jsonb"),
|
errhint("Try casting the argument to jsonb"),
|
||||||
parser_errposition(pstate, func->location)));
|
parser_errposition(pstate, func->location)));
|
||||||
|
|
||||||
@ -4466,7 +4466,8 @@ transformJsonFuncExpr(ParseState *pstate, JsonFuncExpr *func)
|
|||||||
if (exprType(contextItemExpr) != JSONBOID)
|
if (exprType(contextItemExpr) != JSONBOID)
|
||||||
ereport(ERROR,
|
ereport(ERROR,
|
||||||
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
|
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
|
||||||
errmsg("%s() is not yet implemented for json type", func_name),
|
errmsg("%s() is not yet implemented for the json type", func_name),
|
||||||
|
errhint("Try casting the argument to jsonb"),
|
||||||
parser_errposition(pstate, func->location)));
|
parser_errposition(pstate, func->location)));
|
||||||
|
|
||||||
return (Node *) jsexpr;
|
return (Node *) jsexpr;
|
||||||
|
@ -1,21 +1,24 @@
|
|||||||
-- JSON_EXISTS
|
-- JSON_EXISTS
|
||||||
SELECT JSON_EXISTS(NULL FORMAT JSON, '$');
|
SELECT JSON_EXISTS(NULL FORMAT JSON, '$');
|
||||||
ERROR: JSON_EXISTS() is not yet implemented for json type
|
ERROR: JSON_EXISTS() is not yet implemented for the json type
|
||||||
LINE 1: SELECT JSON_EXISTS(NULL FORMAT JSON, '$');
|
LINE 1: SELECT JSON_EXISTS(NULL FORMAT JSON, '$');
|
||||||
^
|
^
|
||||||
|
HINT: Try casting the argument to jsonb
|
||||||
-- JSON_VALUE
|
-- JSON_VALUE
|
||||||
SELECT JSON_VALUE(NULL FORMAT JSON, '$');
|
SELECT JSON_VALUE(NULL FORMAT JSON, '$');
|
||||||
ERROR: JSON_VALUE() is not yet implemented for json type
|
ERROR: JSON_VALUE() is not yet implemented for the json type
|
||||||
LINE 1: SELECT JSON_VALUE(NULL FORMAT JSON, '$');
|
LINE 1: SELECT JSON_VALUE(NULL FORMAT JSON, '$');
|
||||||
^
|
^
|
||||||
|
HINT: Try casting the argument to jsonb
|
||||||
-- JSON_QUERY
|
-- JSON_QUERY
|
||||||
SELECT JSON_QUERY(NULL FORMAT JSON, '$');
|
SELECT JSON_QUERY(NULL FORMAT JSON, '$');
|
||||||
ERROR: JSON_QUERY() is not yet implemented for json type
|
ERROR: JSON_QUERY() is not yet implemented for the json type
|
||||||
LINE 1: SELECT JSON_QUERY(NULL FORMAT JSON, '$');
|
LINE 1: SELECT JSON_QUERY(NULL FORMAT JSON, '$');
|
||||||
^
|
^
|
||||||
|
HINT: Try casting the argument to jsonb
|
||||||
-- JSON_TABLE
|
-- JSON_TABLE
|
||||||
SELECT * FROM JSON_TABLE(NULL FORMAT JSON, '$' COLUMNS (foo text));
|
SELECT * FROM JSON_TABLE(NULL FORMAT JSON, '$' COLUMNS (foo text));
|
||||||
ERROR: JSON_TABLE() is not yet implemented for json type
|
ERROR: JSON_TABLE() is not yet implemented for the json type
|
||||||
LINE 1: SELECT * FROM JSON_TABLE(NULL FORMAT JSON, '$' COLUMNS (foo ...
|
LINE 1: SELECT * FROM JSON_TABLE(NULL FORMAT JSON, '$' COLUMNS (foo ...
|
||||||
^
|
^
|
||||||
HINT: Try casting the argument to jsonb
|
HINT: Try casting the argument to jsonb
|
||||||
|
Loading…
x
Reference in New Issue
Block a user