diff options
| author | Tom Lane <tgl@sss.pgh.pa.us> | 2022-12-11 11:28:15 -0500 |
|---|---|---|
| committer | Tom Lane <tgl@sss.pgh.pa.us> | 2022-12-11 11:28:15 -0500 |
| commit | c60c9badba9b4db3155eef081ae0b923f983168c (patch) | |
| tree | 60b12d49fa9f01feff7707cef18fac7ebf24ab18 /src/test/regress/sql/json_encoding.sql | |
| parent | 50428a301d5ad46316cac2192f2ca8d91898aa3c (diff) | |
| download | postgresql-c60c9badba9b4db3155eef081ae0b923f983168c.tar.gz | |
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
Diffstat (limited to 'src/test/regress/sql/json_encoding.sql')
| -rw-r--r-- | src/test/regress/sql/json_encoding.sql | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/test/regress/sql/json_encoding.sql b/src/test/regress/sql/json_encoding.sql index d7fac69733..f87b3bd4f3 100644 --- a/src/test/regress/sql/json_encoding.sql +++ b/src/test/regress/sql/json_encoding.sql @@ -76,3 +76,7 @@ SELECT jsonb '{ "a": "dollar \u0024 character" }' ->> 'a' as correct_everywhere SELECT jsonb '{ "a": "dollar \\u0024 character" }' ->> 'a' as not_an_escape; SELECT jsonb '{ "a": "null \u0000 escape" }' ->> 'a' as fails; SELECT jsonb '{ "a": "null \\u0000 escape" }' ->> 'a' as not_an_escape; + +-- soft error for input-time failure + +select pg_input_error_message('{ "a": "\ud83d\ude04\ud83d\udc36" }', 'jsonb'); |
