From c60c9badba9b4db3155eef081ae0b923f983168c Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Sun, 11 Dec 2022 11:28:15 -0500 Subject: Convert json_in and jsonb_in to report errors softly. This requires a bit of further infrastructure-extension to allow trapping errors reported by numeric_in and pg_unicode_to_server, but otherwise it's pretty straightforward. In the case of jsonb_in, we are only capturing errors reported during the initial "parse" phase. The value-construction phase (JsonbValueToJsonb) can also throw errors if assorted implementation limits are exceeded. We should improve that, but it seems like a separable project. Andrew Dunstan and Tom Lane Discussion: https://postgr.es/m/3bac9841-fe07-713d-fa42-606c225567d6@dunslane.net --- src/include/common/jsonapi.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/include/common/jsonapi.h') diff --git a/src/include/common/jsonapi.h b/src/include/common/jsonapi.h index 663064e659d..884c86cae7f 100644 --- a/src/include/common/jsonapi.h +++ b/src/include/common/jsonapi.h @@ -51,6 +51,7 @@ typedef enum JsonParseErrorType JSON_UNICODE_CODE_POINT_ZERO, JSON_UNICODE_ESCAPE_FORMAT, JSON_UNICODE_HIGH_ESCAPE, + JSON_UNICODE_UNTRANSLATABLE, JSON_UNICODE_HIGH_SURROGATE, JSON_UNICODE_LOW_SURROGATE, JSON_SEM_ACTION_FAILED /* error should already be reported */ -- cgit v1.2.3