diff options
Diffstat (limited to 'doc/src')
-rw-r--r-- | doc/src/sgml/json.sgml | 19 | ||||
-rw-r--r-- | doc/src/sgml/release-9.4.sgml | 16 |
2 files changed, 11 insertions, 24 deletions
diff --git a/doc/src/sgml/json.sgml b/doc/src/sgml/json.sgml index 8feb2fbf0ad..6282ab88539 100644 --- a/doc/src/sgml/json.sgml +++ b/doc/src/sgml/json.sgml @@ -69,12 +69,14 @@ regardless of the database encoding, and are checked only for syntactic correctness (that is, that four hex digits follow <literal>\u</>). However, the input function for <type>jsonb</> is stricter: it disallows - Unicode escapes for non-ASCII characters (those - above <literal>U+007F</>) unless the database encoding is UTF8. It also - insists that any use of Unicode surrogate pairs to designate characters - outside the Unicode Basic Multilingual Plane be correct. Valid Unicode - escapes, except for <literal>\u0000</>, are then converted to the - equivalent ASCII or UTF8 character for storage. + Unicode escapes for non-ASCII characters (those above <literal>U+007F</>) + unless the database encoding is UTF8. The <type>jsonb</> type also + rejects <literal>\u0000</> (because that cannot be represented in + <productname>PostgreSQL</productname>'s <type>text</> type), and it insists + that any use of Unicode surrogate pairs to designate characters outside + the Unicode Basic Multilingual Plane be correct. Valid Unicode escapes + are converted to the equivalent ASCII or UTF8 character for storage; + this includes folding surrogate pairs into a single character. </para> <note> @@ -101,7 +103,7 @@ constitutes valid <type>jsonb</type> data that do not apply to the <type>json</type> type, nor to JSON in the abstract, corresponding to limits on what can be represented by the underlying data type. - Specifically, <type>jsonb</> will reject numbers that are outside the + Notably, <type>jsonb</> will reject numbers that are outside the range of the <productname>PostgreSQL</productname> <type>numeric</> data type, while <type>json</> will not. Such implementation-defined restrictions are permitted by <acronym>RFC</> 7159. However, in @@ -134,7 +136,8 @@ <row> <entry><type>string</></entry> <entry><type>text</></entry> - <entry>See notes above concerning encoding restrictions</entry> + <entry><literal>\u0000</> is disallowed, as are non-ASCII Unicode + escapes if database encoding is not UTF8</entry> </row> <row> <entry><type>number</></entry> diff --git a/doc/src/sgml/release-9.4.sgml b/doc/src/sgml/release-9.4.sgml index 961e4617978..11bbf3bf36c 100644 --- a/doc/src/sgml/release-9.4.sgml +++ b/doc/src/sgml/release-9.4.sgml @@ -103,22 +103,6 @@ <listitem> <para> - Unicode escapes in <link linkend="datatype-json"><type>JSON</type></link> - text values are no longer rendered with the backslash escaped - (Andrew Dunstan) - </para> - - <para> - Previously, all backslashes in text values being formed into JSON - were escaped. Now a backslash followed by <literal>u</> and four - hexadecimal digits is not escaped, as this is a legal sequence in a - JSON string value, and escaping the backslash led to some perverse - results. - </para> - </listitem> - - <listitem> - <para> When converting values of type <type>date</>, <type>timestamp</> or <type>timestamptz</> to <link linkend="datatype-json"><type>JSON</type></link>, render the |