Refine error messages
"JSON" when not referring to a data type should be upper case.
This commit is contained in:
parent
3a675f729e
commit
831f5d11ec
|
@ -2326,12 +2326,12 @@ populate_array_report_expected_array(PopulateArrayContext *ctx, int ndim)
|
||||||
if (ctx->colname)
|
if (ctx->colname)
|
||||||
ereport(ERROR,
|
ereport(ERROR,
|
||||||
(errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
|
(errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
|
||||||
errmsg("expected json array"),
|
errmsg("expected JSON array"),
|
||||||
errhint("See the value of key \"%s\".", ctx->colname)));
|
errhint("See the value of key \"%s\".", ctx->colname)));
|
||||||
else
|
else
|
||||||
ereport(ERROR,
|
ereport(ERROR,
|
||||||
(errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
|
(errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
|
||||||
errmsg("expected json array")));
|
errmsg("expected JSON array")));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -2348,13 +2348,13 @@ populate_array_report_expected_array(PopulateArrayContext *ctx, int ndim)
|
||||||
if (ctx->colname)
|
if (ctx->colname)
|
||||||
ereport(ERROR,
|
ereport(ERROR,
|
||||||
(errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
|
(errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
|
||||||
errmsg("expected json array"),
|
errmsg("expected JSON array"),
|
||||||
errhint("See the array element %s of key \"%s\".",
|
errhint("See the array element %s of key \"%s\".",
|
||||||
indices.data, ctx->colname)));
|
indices.data, ctx->colname)));
|
||||||
else
|
else
|
||||||
ereport(ERROR,
|
ereport(ERROR,
|
||||||
(errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
|
(errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
|
||||||
errmsg("expected json array"),
|
errmsg("expected JSON array"),
|
||||||
errhint("See the array element %s.",
|
errhint("See the array element %s.",
|
||||||
indices.data)));
|
indices.data)));
|
||||||
}
|
}
|
||||||
|
@ -2390,7 +2390,7 @@ populate_array_check_dimension(PopulateArrayContext *ctx, int ndim)
|
||||||
else if (ctx->dims[ndim] != dim)
|
else if (ctx->dims[ndim] != dim)
|
||||||
ereport(ERROR,
|
ereport(ERROR,
|
||||||
(errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
|
(errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
|
||||||
errmsg("malformed json array"),
|
errmsg("malformed JSON array"),
|
||||||
errdetail("Multidimensional arrays must have "
|
errdetail("Multidimensional arrays must have "
|
||||||
"sub-arrays with matching dimensions.")));
|
"sub-arrays with matching dimensions.")));
|
||||||
|
|
||||||
|
|
|
@ -1401,7 +1401,7 @@ SELECT ia FROM json_populate_record(NULL::jsrec, '{"ia": null}') q;
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
SELECT ia FROM json_populate_record(NULL::jsrec, '{"ia": 123}') q;
|
SELECT ia FROM json_populate_record(NULL::jsrec, '{"ia": 123}') q;
|
||||||
ERROR: expected json array
|
ERROR: expected JSON array
|
||||||
HINT: See the value of key "ia".
|
HINT: See the value of key "ia".
|
||||||
SELECT ia FROM json_populate_record(NULL::jsrec, '{"ia": [1, "2", null, 4]}') q;
|
SELECT ia FROM json_populate_record(NULL::jsrec, '{"ia": [1, "2", null, 4]}') q;
|
||||||
ia
|
ia
|
||||||
|
@ -1416,10 +1416,10 @@ SELECT ia FROM json_populate_record(NULL::jsrec, '{"ia": [[1, 2], [3, 4]]}') q;
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
SELECT ia FROM json_populate_record(NULL::jsrec, '{"ia": [[1], 2]}') q;
|
SELECT ia FROM json_populate_record(NULL::jsrec, '{"ia": [[1], 2]}') q;
|
||||||
ERROR: expected json array
|
ERROR: expected JSON array
|
||||||
HINT: See the array element [1] of key "ia".
|
HINT: See the array element [1] of key "ia".
|
||||||
SELECT ia FROM json_populate_record(NULL::jsrec, '{"ia": [[1], [2, 3]]}') q;
|
SELECT ia FROM json_populate_record(NULL::jsrec, '{"ia": [[1], [2, 3]]}') q;
|
||||||
ERROR: malformed json array
|
ERROR: malformed JSON array
|
||||||
DETAIL: Multidimensional arrays must have sub-arrays with matching dimensions.
|
DETAIL: Multidimensional arrays must have sub-arrays with matching dimensions.
|
||||||
SELECT ia FROM json_populate_record(NULL::jsrec, '{"ia": "{1,2,3}"}') q;
|
SELECT ia FROM json_populate_record(NULL::jsrec, '{"ia": "{1,2,3}"}') q;
|
||||||
ia
|
ia
|
||||||
|
@ -1434,7 +1434,7 @@ SELECT ia1 FROM json_populate_record(NULL::jsrec, '{"ia1": null}') q;
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
SELECT ia1 FROM json_populate_record(NULL::jsrec, '{"ia1": 123}') q;
|
SELECT ia1 FROM json_populate_record(NULL::jsrec, '{"ia1": 123}') q;
|
||||||
ERROR: expected json array
|
ERROR: expected JSON array
|
||||||
HINT: See the value of key "ia1".
|
HINT: See the value of key "ia1".
|
||||||
SELECT ia1 FROM json_populate_record(NULL::jsrec, '{"ia1": [1, "2", null, 4]}') q;
|
SELECT ia1 FROM json_populate_record(NULL::jsrec, '{"ia1": [1, "2", null, 4]}') q;
|
||||||
ia1
|
ia1
|
||||||
|
@ -1455,7 +1455,7 @@ SELECT ia1d FROM json_populate_record(NULL::jsrec, '{"ia1d": null}') q;
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
SELECT ia1d FROM json_populate_record(NULL::jsrec, '{"ia1d": 123}') q;
|
SELECT ia1d FROM json_populate_record(NULL::jsrec, '{"ia1d": 123}') q;
|
||||||
ERROR: expected json array
|
ERROR: expected JSON array
|
||||||
HINT: See the value of key "ia1d".
|
HINT: See the value of key "ia1d".
|
||||||
SELECT ia1d FROM json_populate_record(NULL::jsrec, '{"ia1d": [1, "2", null, 4]}') q;
|
SELECT ia1d FROM json_populate_record(NULL::jsrec, '{"ia1d": [1, "2", null, 4]}') q;
|
||||||
ERROR: value for domain js_int_array_1d violates check constraint "js_int_array_1d_check"
|
ERROR: value for domain js_int_array_1d violates check constraint "js_int_array_1d_check"
|
||||||
|
@ -1484,10 +1484,10 @@ SELECT ia2 FROM json_populate_record(NULL::jsrec, '{"ia2": [[], []]}') q;
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
SELECT ia2 FROM json_populate_record(NULL::jsrec, '{"ia2": [[1, 2], [3]]}') q;
|
SELECT ia2 FROM json_populate_record(NULL::jsrec, '{"ia2": [[1, 2], [3]]}') q;
|
||||||
ERROR: malformed json array
|
ERROR: malformed JSON array
|
||||||
DETAIL: Multidimensional arrays must have sub-arrays with matching dimensions.
|
DETAIL: Multidimensional arrays must have sub-arrays with matching dimensions.
|
||||||
SELECT ia2 FROM json_populate_record(NULL::jsrec, '{"ia2": [[1, 2], 3, 4]}') q;
|
SELECT ia2 FROM json_populate_record(NULL::jsrec, '{"ia2": [[1, 2], 3, 4]}') q;
|
||||||
ERROR: expected json array
|
ERROR: expected JSON array
|
||||||
HINT: See the array element [1] of key "ia2".
|
HINT: See the array element [1] of key "ia2".
|
||||||
SELECT ia2d FROM json_populate_record(NULL::jsrec, '{"ia2d": [[1, "2"], [null, 4]]}') q;
|
SELECT ia2d FROM json_populate_record(NULL::jsrec, '{"ia2d": [[1, "2"], [null, 4]]}') q;
|
||||||
ERROR: value for domain js_int_array_2d violates check constraint "js_int_array_2d_check"
|
ERROR: value for domain js_int_array_2d violates check constraint "js_int_array_2d_check"
|
||||||
|
@ -1528,7 +1528,7 @@ SELECT ia3 FROM json_populate_record(NULL::jsrec, '{"ia3": [ [[1, 2], [3, 4]], [
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
SELECT ia3 FROM json_populate_record(NULL::jsrec, '{"ia3": [ [[1, 2], [3, 4]], [[5, 6], [7, 8], [9, 10]] ]}') q;
|
SELECT ia3 FROM json_populate_record(NULL::jsrec, '{"ia3": [ [[1, 2], [3, 4]], [[5, 6], [7, 8], [9, 10]] ]}') q;
|
||||||
ERROR: malformed json array
|
ERROR: malformed JSON array
|
||||||
DETAIL: Multidimensional arrays must have sub-arrays with matching dimensions.
|
DETAIL: Multidimensional arrays must have sub-arrays with matching dimensions.
|
||||||
SELECT ta FROM json_populate_record(NULL::jsrec, '{"ta": null}') q;
|
SELECT ta FROM json_populate_record(NULL::jsrec, '{"ta": null}') q;
|
||||||
ta
|
ta
|
||||||
|
@ -1537,7 +1537,7 @@ SELECT ta FROM json_populate_record(NULL::jsrec, '{"ta": null}') q;
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
SELECT ta FROM json_populate_record(NULL::jsrec, '{"ta": 123}') q;
|
SELECT ta FROM json_populate_record(NULL::jsrec, '{"ta": 123}') q;
|
||||||
ERROR: expected json array
|
ERROR: expected JSON array
|
||||||
HINT: See the value of key "ta".
|
HINT: See the value of key "ta".
|
||||||
SELECT ta FROM json_populate_record(NULL::jsrec, '{"ta": [1, "2", null, 4]}') q;
|
SELECT ta FROM json_populate_record(NULL::jsrec, '{"ta": [1, "2", null, 4]}') q;
|
||||||
ta
|
ta
|
||||||
|
@ -1546,7 +1546,7 @@ SELECT ta FROM json_populate_record(NULL::jsrec, '{"ta": [1, "2", null, 4]}') q;
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
SELECT ta FROM json_populate_record(NULL::jsrec, '{"ta": [[1, 2, 3], {"k": "v"}]}') q;
|
SELECT ta FROM json_populate_record(NULL::jsrec, '{"ta": [[1, 2, 3], {"k": "v"}]}') q;
|
||||||
ERROR: expected json array
|
ERROR: expected JSON array
|
||||||
HINT: See the array element [1] of key "ta".
|
HINT: See the array element [1] of key "ta".
|
||||||
SELECT c FROM json_populate_record(NULL::jsrec, '{"c": null}') q;
|
SELECT c FROM json_populate_record(NULL::jsrec, '{"c": null}') q;
|
||||||
c
|
c
|
||||||
|
@ -1575,7 +1575,7 @@ SELECT ca FROM json_populate_record(NULL::jsrec, '{"ca": null}') q;
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
SELECT ca FROM json_populate_record(NULL::jsrec, '{"ca": 123}') q;
|
SELECT ca FROM json_populate_record(NULL::jsrec, '{"ca": 123}') q;
|
||||||
ERROR: expected json array
|
ERROR: expected JSON array
|
||||||
HINT: See the value of key "ca".
|
HINT: See the value of key "ca".
|
||||||
SELECT ca FROM json_populate_record(NULL::jsrec, '{"ca": [1, "2", null, 4]}') q;
|
SELECT ca FROM json_populate_record(NULL::jsrec, '{"ca": [1, "2", null, 4]}') q;
|
||||||
ca
|
ca
|
||||||
|
@ -1586,7 +1586,7 @@ SELECT ca FROM json_populate_record(NULL::jsrec, '{"ca": [1, "2", null, 4]}') q;
|
||||||
SELECT ca FROM json_populate_record(NULL::jsrec, '{"ca": ["aaaaaaaaaaaaaaaa"]}') q;
|
SELECT ca FROM json_populate_record(NULL::jsrec, '{"ca": ["aaaaaaaaaaaaaaaa"]}') q;
|
||||||
ERROR: value too long for type character(10)
|
ERROR: value too long for type character(10)
|
||||||
SELECT ca FROM json_populate_record(NULL::jsrec, '{"ca": [[1, 2, 3], {"k": "v"}]}') q;
|
SELECT ca FROM json_populate_record(NULL::jsrec, '{"ca": [[1, 2, 3], {"k": "v"}]}') q;
|
||||||
ERROR: expected json array
|
ERROR: expected JSON array
|
||||||
HINT: See the array element [1] of key "ca".
|
HINT: See the array element [1] of key "ca".
|
||||||
SELECT js FROM json_populate_record(NULL::jsrec, '{"js": null}') q;
|
SELECT js FROM json_populate_record(NULL::jsrec, '{"js": null}') q;
|
||||||
js
|
js
|
||||||
|
@ -1679,7 +1679,7 @@ SELECT jsa FROM json_populate_record(NULL::jsrec, '{"jsa": null}') q;
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
SELECT jsa FROM json_populate_record(NULL::jsrec, '{"jsa": 123}') q;
|
SELECT jsa FROM json_populate_record(NULL::jsrec, '{"jsa": 123}') q;
|
||||||
ERROR: expected json array
|
ERROR: expected JSON array
|
||||||
HINT: See the value of key "jsa".
|
HINT: See the value of key "jsa".
|
||||||
SELECT jsa FROM json_populate_record(NULL::jsrec, '{"jsa": [1, "2", null, 4]}') q;
|
SELECT jsa FROM json_populate_record(NULL::jsrec, '{"jsa": [1, "2", null, 4]}') q;
|
||||||
jsa
|
jsa
|
||||||
|
@ -1710,7 +1710,7 @@ SELECT rec FROM json_populate_record(NULL::jsrec, '{"rec": "(abc,42,01.02.2003)"
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
SELECT reca FROM json_populate_record(NULL::jsrec, '{"reca": 123}') q;
|
SELECT reca FROM json_populate_record(NULL::jsrec, '{"reca": 123}') q;
|
||||||
ERROR: expected json array
|
ERROR: expected JSON array
|
||||||
HINT: See the value of key "reca".
|
HINT: See the value of key "reca".
|
||||||
SELECT reca FROM json_populate_record(NULL::jsrec, '{"reca": [1, 2]}') q;
|
SELECT reca FROM json_populate_record(NULL::jsrec, '{"reca": [1, 2]}') q;
|
||||||
ERROR: cannot call populate_composite on a scalar
|
ERROR: cannot call populate_composite on a scalar
|
||||||
|
@ -2215,7 +2215,7 @@ select * from json_to_record('{"ia": null}') as x(ia _int4);
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
select * from json_to_record('{"ia": 123}') as x(ia _int4);
|
select * from json_to_record('{"ia": 123}') as x(ia _int4);
|
||||||
ERROR: expected json array
|
ERROR: expected JSON array
|
||||||
HINT: See the value of key "ia".
|
HINT: See the value of key "ia".
|
||||||
select * from json_to_record('{"ia": [1, "2", null, 4]}') as x(ia _int4);
|
select * from json_to_record('{"ia": [1, "2", null, 4]}') as x(ia _int4);
|
||||||
ia
|
ia
|
||||||
|
@ -2230,10 +2230,10 @@ select * from json_to_record('{"ia": [[1, 2], [3, 4]]}') as x(ia _int4);
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
select * from json_to_record('{"ia": [[1], 2]}') as x(ia _int4);
|
select * from json_to_record('{"ia": [[1], 2]}') as x(ia _int4);
|
||||||
ERROR: expected json array
|
ERROR: expected JSON array
|
||||||
HINT: See the array element [1] of key "ia".
|
HINT: See the array element [1] of key "ia".
|
||||||
select * from json_to_record('{"ia": [[1], [2, 3]]}') as x(ia _int4);
|
select * from json_to_record('{"ia": [[1], [2, 3]]}') as x(ia _int4);
|
||||||
ERROR: malformed json array
|
ERROR: malformed JSON array
|
||||||
DETAIL: Multidimensional arrays must have sub-arrays with matching dimensions.
|
DETAIL: Multidimensional arrays must have sub-arrays with matching dimensions.
|
||||||
select * from json_to_record('{"ia2": [1, 2, 3]}') as x(ia2 int[][]);
|
select * from json_to_record('{"ia2": [1, 2, 3]}') as x(ia2 int[][]);
|
||||||
ia2
|
ia2
|
||||||
|
|
|
@ -2090,7 +2090,7 @@ SELECT ia FROM jsonb_populate_record(NULL::jsbrec, '{"ia": null}') q;
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
SELECT ia FROM jsonb_populate_record(NULL::jsbrec, '{"ia": 123}') q;
|
SELECT ia FROM jsonb_populate_record(NULL::jsbrec, '{"ia": 123}') q;
|
||||||
ERROR: expected json array
|
ERROR: expected JSON array
|
||||||
HINT: See the value of key "ia".
|
HINT: See the value of key "ia".
|
||||||
SELECT ia FROM jsonb_populate_record(NULL::jsbrec, '{"ia": [1, "2", null, 4]}') q;
|
SELECT ia FROM jsonb_populate_record(NULL::jsbrec, '{"ia": [1, "2", null, 4]}') q;
|
||||||
ia
|
ia
|
||||||
|
@ -2105,10 +2105,10 @@ SELECT ia FROM jsonb_populate_record(NULL::jsbrec, '{"ia": [[1, 2], [3, 4]]}') q
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
SELECT ia FROM jsonb_populate_record(NULL::jsbrec, '{"ia": [[1], 2]}') q;
|
SELECT ia FROM jsonb_populate_record(NULL::jsbrec, '{"ia": [[1], 2]}') q;
|
||||||
ERROR: expected json array
|
ERROR: expected JSON array
|
||||||
HINT: See the array element [1] of key "ia".
|
HINT: See the array element [1] of key "ia".
|
||||||
SELECT ia FROM jsonb_populate_record(NULL::jsbrec, '{"ia": [[1], [2, 3]]}') q;
|
SELECT ia FROM jsonb_populate_record(NULL::jsbrec, '{"ia": [[1], [2, 3]]}') q;
|
||||||
ERROR: malformed json array
|
ERROR: malformed JSON array
|
||||||
DETAIL: Multidimensional arrays must have sub-arrays with matching dimensions.
|
DETAIL: Multidimensional arrays must have sub-arrays with matching dimensions.
|
||||||
SELECT ia FROM jsonb_populate_record(NULL::jsbrec, '{"ia": "{1,2,3}"}') q;
|
SELECT ia FROM jsonb_populate_record(NULL::jsbrec, '{"ia": "{1,2,3}"}') q;
|
||||||
ia
|
ia
|
||||||
|
@ -2123,7 +2123,7 @@ SELECT ia1 FROM jsonb_populate_record(NULL::jsbrec, '{"ia1": null}') q;
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
SELECT ia1 FROM jsonb_populate_record(NULL::jsbrec, '{"ia1": 123}') q;
|
SELECT ia1 FROM jsonb_populate_record(NULL::jsbrec, '{"ia1": 123}') q;
|
||||||
ERROR: expected json array
|
ERROR: expected JSON array
|
||||||
HINT: See the value of key "ia1".
|
HINT: See the value of key "ia1".
|
||||||
SELECT ia1 FROM jsonb_populate_record(NULL::jsbrec, '{"ia1": [1, "2", null, 4]}') q;
|
SELECT ia1 FROM jsonb_populate_record(NULL::jsbrec, '{"ia1": [1, "2", null, 4]}') q;
|
||||||
ia1
|
ia1
|
||||||
|
@ -2144,7 +2144,7 @@ SELECT ia1d FROM jsonb_populate_record(NULL::jsbrec, '{"ia1d": null}') q;
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
SELECT ia1d FROM jsonb_populate_record(NULL::jsbrec, '{"ia1d": 123}') q;
|
SELECT ia1d FROM jsonb_populate_record(NULL::jsbrec, '{"ia1d": 123}') q;
|
||||||
ERROR: expected json array
|
ERROR: expected JSON array
|
||||||
HINT: See the value of key "ia1d".
|
HINT: See the value of key "ia1d".
|
||||||
SELECT ia1d FROM jsonb_populate_record(NULL::jsbrec, '{"ia1d": [1, "2", null, 4]}') q;
|
SELECT ia1d FROM jsonb_populate_record(NULL::jsbrec, '{"ia1d": [1, "2", null, 4]}') q;
|
||||||
ERROR: value for domain jsb_int_array_1d violates check constraint "jsb_int_array_1d_check"
|
ERROR: value for domain jsb_int_array_1d violates check constraint "jsb_int_array_1d_check"
|
||||||
|
@ -2173,10 +2173,10 @@ SELECT ia2 FROM jsonb_populate_record(NULL::jsbrec, '{"ia2": [[], []]}') q;
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
SELECT ia2 FROM jsonb_populate_record(NULL::jsbrec, '{"ia2": [[1, 2], [3]]}') q;
|
SELECT ia2 FROM jsonb_populate_record(NULL::jsbrec, '{"ia2": [[1, 2], [3]]}') q;
|
||||||
ERROR: malformed json array
|
ERROR: malformed JSON array
|
||||||
DETAIL: Multidimensional arrays must have sub-arrays with matching dimensions.
|
DETAIL: Multidimensional arrays must have sub-arrays with matching dimensions.
|
||||||
SELECT ia2 FROM jsonb_populate_record(NULL::jsbrec, '{"ia2": [[1, 2], 3, 4]}') q;
|
SELECT ia2 FROM jsonb_populate_record(NULL::jsbrec, '{"ia2": [[1, 2], 3, 4]}') q;
|
||||||
ERROR: expected json array
|
ERROR: expected JSON array
|
||||||
HINT: See the array element [1] of key "ia2".
|
HINT: See the array element [1] of key "ia2".
|
||||||
SELECT ia2d FROM jsonb_populate_record(NULL::jsbrec, '{"ia2d": [[1, "2"], [null, 4]]}') q;
|
SELECT ia2d FROM jsonb_populate_record(NULL::jsbrec, '{"ia2d": [[1, "2"], [null, 4]]}') q;
|
||||||
ERROR: value for domain jsb_int_array_2d violates check constraint "jsb_int_array_2d_check"
|
ERROR: value for domain jsb_int_array_2d violates check constraint "jsb_int_array_2d_check"
|
||||||
|
@ -2217,7 +2217,7 @@ SELECT ia3 FROM jsonb_populate_record(NULL::jsbrec, '{"ia3": [ [[1, 2], [3, 4]],
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
SELECT ia3 FROM jsonb_populate_record(NULL::jsbrec, '{"ia3": [ [[1, 2], [3, 4]], [[5, 6], [7, 8], [9, 10]] ]}') q;
|
SELECT ia3 FROM jsonb_populate_record(NULL::jsbrec, '{"ia3": [ [[1, 2], [3, 4]], [[5, 6], [7, 8], [9, 10]] ]}') q;
|
||||||
ERROR: malformed json array
|
ERROR: malformed JSON array
|
||||||
DETAIL: Multidimensional arrays must have sub-arrays with matching dimensions.
|
DETAIL: Multidimensional arrays must have sub-arrays with matching dimensions.
|
||||||
SELECT ta FROM jsonb_populate_record(NULL::jsbrec, '{"ta": null}') q;
|
SELECT ta FROM jsonb_populate_record(NULL::jsbrec, '{"ta": null}') q;
|
||||||
ta
|
ta
|
||||||
|
@ -2226,7 +2226,7 @@ SELECT ta FROM jsonb_populate_record(NULL::jsbrec, '{"ta": null}') q;
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
SELECT ta FROM jsonb_populate_record(NULL::jsbrec, '{"ta": 123}') q;
|
SELECT ta FROM jsonb_populate_record(NULL::jsbrec, '{"ta": 123}') q;
|
||||||
ERROR: expected json array
|
ERROR: expected JSON array
|
||||||
HINT: See the value of key "ta".
|
HINT: See the value of key "ta".
|
||||||
SELECT ta FROM jsonb_populate_record(NULL::jsbrec, '{"ta": [1, "2", null, 4]}') q;
|
SELECT ta FROM jsonb_populate_record(NULL::jsbrec, '{"ta": [1, "2", null, 4]}') q;
|
||||||
ta
|
ta
|
||||||
|
@ -2235,7 +2235,7 @@ SELECT ta FROM jsonb_populate_record(NULL::jsbrec, '{"ta": [1, "2", null, 4]}')
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
SELECT ta FROM jsonb_populate_record(NULL::jsbrec, '{"ta": [[1, 2, 3], {"k": "v"}]}') q;
|
SELECT ta FROM jsonb_populate_record(NULL::jsbrec, '{"ta": [[1, 2, 3], {"k": "v"}]}') q;
|
||||||
ERROR: expected json array
|
ERROR: expected JSON array
|
||||||
HINT: See the array element [1] of key "ta".
|
HINT: See the array element [1] of key "ta".
|
||||||
SELECT c FROM jsonb_populate_record(NULL::jsbrec, '{"c": null}') q;
|
SELECT c FROM jsonb_populate_record(NULL::jsbrec, '{"c": null}') q;
|
||||||
c
|
c
|
||||||
|
@ -2264,7 +2264,7 @@ SELECT ca FROM jsonb_populate_record(NULL::jsbrec, '{"ca": null}') q;
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
SELECT ca FROM jsonb_populate_record(NULL::jsbrec, '{"ca": 123}') q;
|
SELECT ca FROM jsonb_populate_record(NULL::jsbrec, '{"ca": 123}') q;
|
||||||
ERROR: expected json array
|
ERROR: expected JSON array
|
||||||
HINT: See the value of key "ca".
|
HINT: See the value of key "ca".
|
||||||
SELECT ca FROM jsonb_populate_record(NULL::jsbrec, '{"ca": [1, "2", null, 4]}') q;
|
SELECT ca FROM jsonb_populate_record(NULL::jsbrec, '{"ca": [1, "2", null, 4]}') q;
|
||||||
ca
|
ca
|
||||||
|
@ -2275,7 +2275,7 @@ SELECT ca FROM jsonb_populate_record(NULL::jsbrec, '{"ca": [1, "2", null, 4]}')
|
||||||
SELECT ca FROM jsonb_populate_record(NULL::jsbrec, '{"ca": ["aaaaaaaaaaaaaaaa"]}') q;
|
SELECT ca FROM jsonb_populate_record(NULL::jsbrec, '{"ca": ["aaaaaaaaaaaaaaaa"]}') q;
|
||||||
ERROR: value too long for type character(10)
|
ERROR: value too long for type character(10)
|
||||||
SELECT ca FROM jsonb_populate_record(NULL::jsbrec, '{"ca": [[1, 2, 3], {"k": "v"}]}') q;
|
SELECT ca FROM jsonb_populate_record(NULL::jsbrec, '{"ca": [[1, 2, 3], {"k": "v"}]}') q;
|
||||||
ERROR: expected json array
|
ERROR: expected JSON array
|
||||||
HINT: See the array element [1] of key "ca".
|
HINT: See the array element [1] of key "ca".
|
||||||
SELECT js FROM jsonb_populate_record(NULL::jsbrec, '{"js": null}') q;
|
SELECT js FROM jsonb_populate_record(NULL::jsbrec, '{"js": null}') q;
|
||||||
js
|
js
|
||||||
|
@ -2368,7 +2368,7 @@ SELECT jsa FROM jsonb_populate_record(NULL::jsbrec, '{"jsa": null}') q;
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
SELECT jsa FROM jsonb_populate_record(NULL::jsbrec, '{"jsa": 123}') q;
|
SELECT jsa FROM jsonb_populate_record(NULL::jsbrec, '{"jsa": 123}') q;
|
||||||
ERROR: expected json array
|
ERROR: expected JSON array
|
||||||
HINT: See the value of key "jsa".
|
HINT: See the value of key "jsa".
|
||||||
SELECT jsa FROM jsonb_populate_record(NULL::jsbrec, '{"jsa": [1, "2", null, 4]}') q;
|
SELECT jsa FROM jsonb_populate_record(NULL::jsbrec, '{"jsa": [1, "2", null, 4]}') q;
|
||||||
jsa
|
jsa
|
||||||
|
@ -2399,7 +2399,7 @@ SELECT rec FROM jsonb_populate_record(NULL::jsbrec, '{"rec": "(abc,42,01.02.2003
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
SELECT reca FROM jsonb_populate_record(NULL::jsbrec, '{"reca": 123}') q;
|
SELECT reca FROM jsonb_populate_record(NULL::jsbrec, '{"reca": 123}') q;
|
||||||
ERROR: expected json array
|
ERROR: expected JSON array
|
||||||
HINT: See the value of key "reca".
|
HINT: See the value of key "reca".
|
||||||
SELECT reca FROM jsonb_populate_record(NULL::jsbrec, '{"reca": [1, 2]}') q;
|
SELECT reca FROM jsonb_populate_record(NULL::jsbrec, '{"reca": [1, 2]}') q;
|
||||||
ERROR: cannot call populate_composite on a scalar
|
ERROR: cannot call populate_composite on a scalar
|
||||||
|
@ -2591,7 +2591,7 @@ select * from jsonb_to_record('{"ia": null}') as x(ia _int4);
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
select * from jsonb_to_record('{"ia": 123}') as x(ia _int4);
|
select * from jsonb_to_record('{"ia": 123}') as x(ia _int4);
|
||||||
ERROR: expected json array
|
ERROR: expected JSON array
|
||||||
HINT: See the value of key "ia".
|
HINT: See the value of key "ia".
|
||||||
select * from jsonb_to_record('{"ia": [1, "2", null, 4]}') as x(ia _int4);
|
select * from jsonb_to_record('{"ia": [1, "2", null, 4]}') as x(ia _int4);
|
||||||
ia
|
ia
|
||||||
|
@ -2606,10 +2606,10 @@ select * from jsonb_to_record('{"ia": [[1, 2], [3, 4]]}') as x(ia _int4);
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
select * from jsonb_to_record('{"ia": [[1], 2]}') as x(ia _int4);
|
select * from jsonb_to_record('{"ia": [[1], 2]}') as x(ia _int4);
|
||||||
ERROR: expected json array
|
ERROR: expected JSON array
|
||||||
HINT: See the array element [1] of key "ia".
|
HINT: See the array element [1] of key "ia".
|
||||||
select * from jsonb_to_record('{"ia": [[1], [2, 3]]}') as x(ia _int4);
|
select * from jsonb_to_record('{"ia": [[1], [2, 3]]}') as x(ia _int4);
|
||||||
ERROR: malformed json array
|
ERROR: malformed JSON array
|
||||||
DETAIL: Multidimensional arrays must have sub-arrays with matching dimensions.
|
DETAIL: Multidimensional arrays must have sub-arrays with matching dimensions.
|
||||||
select * from jsonb_to_record('{"ia2": [1, 2, 3]}') as x(ia2 int[][]);
|
select * from jsonb_to_record('{"ia2": [1, 2, 3]}') as x(ia2 int[][]);
|
||||||
ia2
|
ia2
|
||||||
|
|
Loading…
Reference in New Issue