jsonpath_exec_fix_a_type_name.patch
text/x-patch
Filename: jsonpath_exec_fix_a_type_name.patch
Type: text/x-patch
Part: 0
Message:
Re: More new SQL/JSON item methods
Patch
Same data as JSON:
GET /api/v1/attachments/:id/patch
the parsed metadata as JSON — format, series position, per-file stats; never the diff bytes.
API reference →
Format: unified
| File | + | − |
|---|---|---|
| src/backend/utils/adt/jsonpath_exec.c | 4 | 4 |
| src/test/regress/expected/jsonb_jsonpath.out | 12 | 12 |
diff --git a/src/backend/utils/adt/jsonpath_exec.c b/src/backend/utils/adt/jsonpath_exec.c
index 22f598cd35..c10926a8a2 100644
--- a/src/backend/utils/adt/jsonpath_exec.c
+++ b/src/backend/utils/adt/jsonpath_exec.c
@@ -1287,7 +1287,7 @@ executeItemOptUnwrapTarget(JsonPathExecContext *cxt, JsonPathItem *jsp,
if (numeric_is_nan(num) || numeric_is_inf(num))
RETURN_ERROR(ereport(ERROR,
(errcode(ERRCODE_NON_NUMERIC_SQL_JSON_ITEM),
- errmsg("numeric argument of jsonpath item method .%s() is out of range for type decimal or number",
+ errmsg("numeric argument of jsonpath item method .%s() is out of range for type decimal or numeric",
jspOperationName(jsp->type)))));
if (jsp->type == jpiDecimal)
@@ -1312,14 +1312,14 @@ executeItemOptUnwrapTarget(JsonPathExecContext *cxt, JsonPathItem *jsp,
if (!noerr || escontext.error_occurred)
RETURN_ERROR(ereport(ERROR,
(errcode(ERRCODE_NON_NUMERIC_SQL_JSON_ITEM),
- errmsg("string argument of jsonpath item method .%s() is not a valid representation of a decimal or number",
+ errmsg("string argument of jsonpath item method .%s() is not a valid representation of a decimal or numeric",
jspOperationName(jsp->type)))));
num = DatumGetNumeric(datum);
if (numeric_is_nan(num) || numeric_is_inf(num))
RETURN_ERROR(ereport(ERROR,
(errcode(ERRCODE_NON_NUMERIC_SQL_JSON_ITEM),
- errmsg("string argument of jsonpath item method .%s() is not a valid representation of a decimal or number",
+ errmsg("string argument of jsonpath item method .%s() is not a valid representation of a decimal or numeric",
jspOperationName(jsp->type)))));
res = jperOk;
@@ -1401,7 +1401,7 @@ executeItemOptUnwrapTarget(JsonPathExecContext *cxt, JsonPathItem *jsp,
if (!noerr || escontext.error_occurred)
RETURN_ERROR(ereport(ERROR,
(errcode(ERRCODE_NON_NUMERIC_SQL_JSON_ITEM),
- errmsg("string argument of jsonpath item method .%s() is not a valid representation of a decimal or number",
+ errmsg("string argument of jsonpath item method .%s() is not a valid representation of a decimal or numeric",
jspOperationName(jsp->type)))));
num = DatumGetNumeric(numdatum);
diff --git a/src/test/regress/expected/jsonb_jsonpath.out b/src/test/regress/expected/jsonb_jsonpath.out
index eea2af30c8..9d8ce48a25 100644
--- a/src/test/regress/expected/jsonb_jsonpath.out
+++ b/src/test/regress/expected/jsonb_jsonpath.out
@@ -2144,7 +2144,7 @@ select jsonb_path_query('"1.23"', '$.decimal()');
(1 row)
select jsonb_path_query('"1.23aaa"', '$.decimal()');
-ERROR: string argument of jsonpath item method .decimal() is not a valid representation of a decimal or number
+ERROR: string argument of jsonpath item method .decimal() is not a valid representation of a decimal or numeric
select jsonb_path_query('1e1000', '$.decimal()');
jsonb_path_query
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
@@ -2152,13 +2152,13 @@ select jsonb_path_query('1e1000', '$.decimal()');
(1 row)
select jsonb_path_query('"nan"', '$.decimal()');
-ERROR: string argument of jsonpath item method .decimal() is not a valid representation of a decimal or number
+ERROR: string argument of jsonpath item method .decimal() is not a valid representation of a decimal or numeric
select jsonb_path_query('"NaN"', '$.decimal()');
-ERROR: string argument of jsonpath item method .decimal() is not a valid representation of a decimal or number
+ERROR: string argument of jsonpath item method .decimal() is not a valid representation of a decimal or numeric
select jsonb_path_query('"inf"', '$.decimal()');
-ERROR: string argument of jsonpath item method .decimal() is not a valid representation of a decimal or number
+ERROR: string argument of jsonpath item method .decimal() is not a valid representation of a decimal or numeric
select jsonb_path_query('"-inf"', '$.decimal()');
-ERROR: string argument of jsonpath item method .decimal() is not a valid representation of a decimal or number
+ERROR: string argument of jsonpath item method .decimal() is not a valid representation of a decimal or numeric
select jsonb_path_query('"inf"', '$.decimal()', silent => true);
jsonb_path_query
------------------
@@ -2224,7 +2224,7 @@ select jsonb_path_query('12345.678', '$.decimal(6, 1)');
(1 row)
select jsonb_path_query('12345.678', '$.decimal(6, 2)');
-ERROR: string argument of jsonpath item method .decimal() is not a valid representation of a decimal or number
+ERROR: string argument of jsonpath item method .decimal() is not a valid representation of a decimal or numeric
select jsonb_path_query('1234.5678', '$.decimal(6, 2)');
jsonb_path_query
------------------
@@ -2232,7 +2232,7 @@ select jsonb_path_query('1234.5678', '$.decimal(6, 2)');
(1 row)
select jsonb_path_query('12345.678', '$.decimal(4, 6)');
-ERROR: string argument of jsonpath item method .decimal() is not a valid representation of a decimal or number
+ERROR: string argument of jsonpath item method .decimal() is not a valid representation of a decimal or numeric
select jsonb_path_query('12345.678', '$.decimal(0, 6)');
ERROR: NUMERIC precision 0 must be between 1 and 1000
select jsonb_path_query('12345.678', '$.decimal(1001, 6)');
@@ -2440,7 +2440,7 @@ select jsonb_path_query('"1.23"', '$.number()');
(1 row)
select jsonb_path_query('"1.23aaa"', '$.number()');
-ERROR: string argument of jsonpath item method .number() is not a valid representation of a decimal or number
+ERROR: string argument of jsonpath item method .number() is not a valid representation of a decimal or numeric
select jsonb_path_query('1e1000', '$.number()');
jsonb_path_query
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
@@ -2448,13 +2448,13 @@ select jsonb_path_query('1e1000', '$.number()');
(1 row)
select jsonb_path_query('"nan"', '$.number()');
-ERROR: string argument of jsonpath item method .number() is not a valid representation of a decimal or number
+ERROR: string argument of jsonpath item method .number() is not a valid representation of a decimal or numeric
select jsonb_path_query('"NaN"', '$.number()');
-ERROR: string argument of jsonpath item method .number() is not a valid representation of a decimal or number
+ERROR: string argument of jsonpath item method .number() is not a valid representation of a decimal or numeric
select jsonb_path_query('"inf"', '$.number()');
-ERROR: string argument of jsonpath item method .number() is not a valid representation of a decimal or number
+ERROR: string argument of jsonpath item method .number() is not a valid representation of a decimal or numeric
select jsonb_path_query('"-inf"', '$.number()');
-ERROR: string argument of jsonpath item method .number() is not a valid representation of a decimal or number
+ERROR: string argument of jsonpath item method .number() is not a valid representation of a decimal or numeric
select jsonb_path_query('"inf"', '$.number()', silent => true);
jsonb_path_query
------------------