json
- json
-
The
jsondata type stores an exact copy of the input text, which must be reparsed on each execution. Because of that,jsonpreserves semantically-insignificant white space between tokens, as well as the order of keys withinJSONobjects.If a
JSONobject within the value contains the same key more than once, all the key/value pairs are kept. (The processing functions consider the last value as the operative one.)The
jsondata type can be used to storeJSONdata. Such data can also be stored as text, but thejsondata type has the advantage of checking that each stored value is a validJSONvalue.RFC 7159 permits
JSONstrings to contain Unicode escape sequences denoted by\uXXXX. In the input function for thejsontype, Unicode escapes are allowed regardless of the database encoding, and are checked only for syntactic correctness (four hex digits must follow \u).No more than 1jsoncolumn in a table is permitted. Additionally, note that only a limited number of fixed or variable-sized columns (approximately totaling 1500 bytes) can be accommodated alongside the JSON datatype.SYSTEM.ADMIN(ADMIN)=> create table testjson1(c1 json, c2 varchar(1500)); CREATE TABLE SYSTEM.ADMIN(ADMIN)=> create table testjson2(c1 json, c2 varchar(1800)); ERROR: Table 'TESTJSON2' record size 65800 exceeds internal limit of 65535 bytes