if (escontext.error_occurred)
RETURN_ERROR(ereport(ERROR,
(errcode(ERRCODE_NON_NUMERIC_SQL_JSON_ITEM),
- errmsg("argument \"%s\" of jsonpath item method .%s() is invalid for type double precision",
- tmp, jspOperationName(jsp->type)))));
+ errmsg("argument \"%s\" of jsonpath item method .%s() is invalid for type %s",
+ tmp, jspOperationName(jsp->type), "double precision"))));
if (isinf(val) || isnan(val))
RETURN_ERROR(ereport(ERROR,
(errcode(ERRCODE_NON_NUMERIC_SQL_JSON_ITEM),
if (escontext.error_occurred)
RETURN_ERROR(ereport(ERROR,
(errcode(ERRCODE_NON_NUMERIC_SQL_JSON_ITEM),
- errmsg("argument \"%s\" of jsonpath item method .%s() is invalid for type double precision",
- tmp, jspOperationName(jsp->type)))));
+ errmsg("argument \"%s\" of jsonpath item method .%s() is invalid for type %s",
+ tmp, jspOperationName(jsp->type), "double precision"))));
if (isinf(val) || isnan(val))
RETURN_ERROR(ereport(ERROR,
(errcode(ERRCODE_NON_NUMERIC_SQL_JSON_ITEM),
if (have_error)
RETURN_ERROR(ereport(ERROR,
(errcode(ERRCODE_NON_NUMERIC_SQL_JSON_ITEM),
- errmsg("argument \"%s\" of jsonpath item method .%s() is invalid for type bigint",
+ errmsg("argument \"%s\" of jsonpath item method .%s() is invalid for type %s",
DatumGetCString(DirectFunctionCall1(numeric_out,
NumericGetDatum(jb->val.numeric))),
- jspOperationName(jsp->type)))));
+ jspOperationName(jsp->type),
+ "bigint"))));
datum = Int64GetDatum(val);
res = jperOk;
if (!noerr || escontext.error_occurred)
RETURN_ERROR(ereport(ERROR,
(errcode(ERRCODE_NON_NUMERIC_SQL_JSON_ITEM),
- errmsg("argument \"%s\" of jsonpath item method .%s() is invalid for type bigint",
- tmp, jspOperationName(jsp->type)))));
+ errmsg("argument \"%s\" of jsonpath item method .%s() is invalid for type %s",
+ tmp, jspOperationName(jsp->type), "bigint"))));
res = jperOk;
}
if (!noerr || escontext.error_occurred)
RETURN_ERROR(ereport(ERROR,
(errcode(ERRCODE_NON_NUMERIC_SQL_JSON_ITEM),
- errmsg("argument \"%s\" of jsonpath item method .%s() is invalid for type boolean",
- tmp, jspOperationName(jsp->type)))));
+ errmsg("argument \"%s\" of jsonpath item method .%s() is invalid for type %s",
+ tmp, jspOperationName(jsp->type), "boolean"))));
ival = DatumGetInt32(datum);
if (ival == 0)
if (!parse_bool(tmp, &bval))
RETURN_ERROR(ereport(ERROR,
(errcode(ERRCODE_NON_NUMERIC_SQL_JSON_ITEM),
- errmsg("argument \"%s\" of jsonpath item method .%s() is invalid for type boolean",
- tmp, jspOperationName(jsp->type)))));
+ errmsg("argument \"%s\" of jsonpath item method .%s() is invalid for type %s",
+ tmp, jspOperationName(jsp->type), "boolean"))));
res = jperOk;
}
if (!noerr || escontext.error_occurred)
RETURN_ERROR(ereport(ERROR,
(errcode(ERRCODE_NON_NUMERIC_SQL_JSON_ITEM),
- errmsg("argument \"%s\" of jsonpath item method .%s() is invalid for type numeric",
- numstr, jspOperationName(jsp->type)))));
+ errmsg("argument \"%s\" of jsonpath item method .%s() is invalid for type %s",
+ numstr, jspOperationName(jsp->type), "numeric"))));
num = DatumGetNumeric(datum);
if (numeric_is_nan(num) || numeric_is_inf(num))
if (!noerr || escontext.error_occurred)
RETURN_ERROR(ereport(ERROR,
(errcode(ERRCODE_NON_NUMERIC_SQL_JSON_ITEM),
- errmsg("argument \"%s\" of jsonpath item method .%s() is invalid for type numeric",
- numstr, jspOperationName(jsp->type)))));
+ errmsg("argument \"%s\" of jsonpath item method .%s() is invalid for type %s",
+ numstr, jspOperationName(jsp->type), "numeric"))));
num = DatumGetNumeric(numdatum);
pfree(arrtypmod);
if (have_error)
RETURN_ERROR(ereport(ERROR,
(errcode(ERRCODE_NON_NUMERIC_SQL_JSON_ITEM),
- errmsg("argument \"%s\" of jsonpath item method .%s() is invalid for type integer",
+ errmsg("argument \"%s\" of jsonpath item method .%s() is invalid for type %s",
DatumGetCString(DirectFunctionCall1(numeric_out,
NumericGetDatum(jb->val.numeric))),
- jspOperationName(jsp->type)))));
+ jspOperationName(jsp->type), "integer"))));
datum = Int32GetDatum(val);
res = jperOk;
if (!noerr || escontext.error_occurred)
RETURN_ERROR(ereport(ERROR,
(errcode(ERRCODE_NON_NUMERIC_SQL_JSON_ITEM),
- errmsg("argument \"%s\" of jsonpath item method .%s() is invalid for type integer",
- tmp, jspOperationName(jsp->type)))));
+ errmsg("argument \"%s\" of jsonpath item method .%s() is invalid for type %s",
+ tmp, jspOperationName(jsp->type), "integer"))));
res = jperOk;
}