1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-02 09:02:37 +03:00

Refine error messages

"JSON" when not referring to a data type should be upper case.
This commit is contained in:
Peter Eisentraut
2018-05-08 14:36:31 -04:00
parent 3a675f729e
commit 831f5d11ec
3 changed files with 39 additions and 39 deletions

View File

@ -2326,12 +2326,12 @@ populate_array_report_expected_array(PopulateArrayContext *ctx, int ndim)
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
{
@ -2348,13 +2348,13 @@ populate_array_report_expected_array(PopulateArrayContext *ctx, int ndim)
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)));
}
@ -2390,7 +2390,7 @@ populate_array_check_dimension(PopulateArrayContext *ctx, int ndim)
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.")));