"JSON" when not referring to a data type should be upper case.
if (ctx->colname)
ereport(ERROR,
(errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
- errmsg("expected json array"),
+ errmsg("expected JSON array"),
errhint("See the value of key \"%s\".", ctx->colname)));
else
ereport(ERROR,
(errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
- errmsg("expected json array")));
+ errmsg("expected JSON array")));
}
else
{
if (ctx->colname)
ereport(ERROR,
(errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
- errmsg("expected json array"),
+ errmsg("expected JSON array"),
errhint("See the array element %s of key \"%s\".",
indices.data, ctx->colname)));
else
ereport(ERROR,
(errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
- errmsg("expected json array"),
+ errmsg("expected JSON array"),
errhint("See the array element %s.",
indices.data)));
}
else if (ctx->dims[ndim] != dim)
ereport(ERROR,
(errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
- errmsg("malformed json array"),
+ errmsg("malformed JSON array"),
errdetail("Multidimensional arrays must have "
"sub-arrays with matching dimensions.")));
(1 row)
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".
SELECT ia FROM json_populate_record(NULL::jsrec, '{"ia": [1, "2", null, 4]}') q;
ia
(1 row)
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".
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.
SELECT ia FROM json_populate_record(NULL::jsrec, '{"ia": "{1,2,3}"}') q;
ia
(1 row)
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".
SELECT ia1 FROM json_populate_record(NULL::jsrec, '{"ia1": [1, "2", null, 4]}') q;
ia1
(1 row)
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".
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"
(1 row)
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.
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".
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"
(1 row)
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.
SELECT ta FROM json_populate_record(NULL::jsrec, '{"ta": null}') q;
ta
(1 row)
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".
SELECT ta FROM json_populate_record(NULL::jsrec, '{"ta": [1, "2", null, 4]}') q;
ta
(1 row)
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".
SELECT c FROM json_populate_record(NULL::jsrec, '{"c": null}') q;
c
(1 row)
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".
SELECT ca FROM json_populate_record(NULL::jsrec, '{"ca": [1, "2", null, 4]}') q;
ca
SELECT ca FROM json_populate_record(NULL::jsrec, '{"ca": ["aaaaaaaaaaaaaaaa"]}') q;
ERROR: value too long for type character(10)
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".
SELECT js FROM json_populate_record(NULL::jsrec, '{"js": null}') q;
js
(1 row)
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".
SELECT jsa FROM json_populate_record(NULL::jsrec, '{"jsa": [1, "2", null, 4]}') q;
jsa
(1 row)
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".
SELECT reca FROM json_populate_record(NULL::jsrec, '{"reca": [1, 2]}') q;
ERROR: cannot call populate_composite on a scalar
(1 row)
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".
select * from json_to_record('{"ia": [1, "2", null, 4]}') as x(ia _int4);
ia
(1 row)
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".
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.
select * from json_to_record('{"ia2": [1, 2, 3]}') as x(ia2 int[][]);
ia2
(1 row)
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".
SELECT ia FROM jsonb_populate_record(NULL::jsbrec, '{"ia": [1, "2", null, 4]}') q;
ia
(1 row)
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".
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.
SELECT ia FROM jsonb_populate_record(NULL::jsbrec, '{"ia": "{1,2,3}"}') q;
ia
(1 row)
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".
SELECT ia1 FROM jsonb_populate_record(NULL::jsbrec, '{"ia1": [1, "2", null, 4]}') q;
ia1
(1 row)
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".
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"
(1 row)
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.
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".
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"
(1 row)
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.
SELECT ta FROM jsonb_populate_record(NULL::jsbrec, '{"ta": null}') q;
ta
(1 row)
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".
SELECT ta FROM jsonb_populate_record(NULL::jsbrec, '{"ta": [1, "2", null, 4]}') q;
ta
(1 row)
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".
SELECT c FROM jsonb_populate_record(NULL::jsbrec, '{"c": null}') q;
c
(1 row)
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".
SELECT ca FROM jsonb_populate_record(NULL::jsbrec, '{"ca": [1, "2", null, 4]}') q;
ca
SELECT ca FROM jsonb_populate_record(NULL::jsbrec, '{"ca": ["aaaaaaaaaaaaaaaa"]}') q;
ERROR: value too long for type character(10)
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".
SELECT js FROM jsonb_populate_record(NULL::jsbrec, '{"js": null}') q;
js
(1 row)
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".
SELECT jsa FROM jsonb_populate_record(NULL::jsbrec, '{"jsa": [1, "2", null, 4]}') q;
jsa
(1 row)
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".
SELECT reca FROM jsonb_populate_record(NULL::jsbrec, '{"reca": [1, 2]}') q;
ERROR: cannot call populate_composite on a scalar
(1 row)
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".
select * from jsonb_to_record('{"ia": [1, "2", null, 4]}') as x(ia _int4);
ia
(1 row)
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".
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.
select * from jsonb_to_record('{"ia2": [1, 2, 3]}') as x(ia2 int[][]);
ia2