aboutsummaryrefslogtreecommitdiff
path: root/doc/src
diff options
context:
space:
mode:
authorRobert Haas <rhaas@postgresql.org>2012-01-31 11:48:23 -0500
committerRobert Haas <rhaas@postgresql.org>2012-01-31 11:48:23 -0500
commit5384a73f98d9829725186a7b65bf4f8adb3cfaf1 (patch)
tree7d0906859b26e82bb5d54a5297c072b708f82dbd /doc/src
parent4c6cedd1b014abf2046886a9a92e10e18f0d658e (diff)
downloadpostgresql-5384a73f98d9829725186a7b65bf4f8adb3cfaf1.tar.gz
postgresql-5384a73f98d9829725186a7b65bf4f8adb3cfaf1.zip
Built-in JSON data type.
Like the XML data type, we simply store JSON data as text, after checking that it is valid. More complex operations such as canonicalization and comparison may come later, but this is enough for not. There are a few open issues here, such as whether we should attempt to detect UTF-8 surrogate pairs represented as \uXXXX\uYYYY, but this gets the basic framework in place.
Diffstat (limited to 'doc/src')
-rw-r--r--doc/src/sgml/datatype.sgml32
1 files changed, 32 insertions, 0 deletions
diff --git a/doc/src/sgml/datatype.sgml b/doc/src/sgml/datatype.sgml
index 152ef2f0378..58e46b58701 100644
--- a/doc/src/sgml/datatype.sgml
+++ b/doc/src/sgml/datatype.sgml
@@ -269,6 +269,12 @@
<entry></entry>
<entry>XML data</entry>
</row>
+
+ <row>
+ <entry><type>json</type></entry>
+ <entry></entry>
+ <entry>JSON data</entry>
+ </row>
</tbody>
</tgroup>
</table>
@@ -4169,6 +4175,32 @@ SET xmloption TO { DOCUMENT | CONTENT };
</sect2>
</sect1>
+ <sect1 id="datatype-json">
+ <title><acronym>JSON</> Type</title>
+
+ <indexterm zone="datatype-json">
+ <primary>JSON</primary>
+ </indexterm>
+
+ <para>
+ The <type>json</type> data type can be used to store JSON data. Such
+ data can also be stored as <type>text</type>, but the
+ <type>json</type> data type has the advantage of checking that each
+ stored value is a valid JSON value.
+ </para>
+
+ <para>
+ <productname>PostgreSQL</productname> allows only one server encoding
+ per database. It is therefore not possible for JSON to conform rigidly
+ to the specification unless the server encoding is UTF-8. Attempts to
+ directly include characters which cannot be represented in the server
+ encoding will fail; conversely, characters which can be represented in
+ the server encoding but not in UTF-8 will be allowed.
+ <literal>\uXXXX</literal> escapes are allowed regardless of the server
+ encoding, and are checked only for syntactic correctness.
+ </para>
+ </sect1>
+
&array;
&rowtypes;