Basic JSON support

From: Itagaki Takahiro <itagaki(dot)takahiro(at)gmail(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Basic JSON support
Date: 2010-09-15 02:32:32
Message-ID: AANLkTina4SNybVwv9xpN16wjBCSy9PjnEQqU96t6gq5J@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Here is a patch for basic JSON support. It adds only those features:
* Add "json" data type, that is binary-compatible with text.
* Syntax checking on text to JSON conversion.
* json_pretty() -- print JSON tree with indentation.

We have "JSON datatype (WIP) 01" item:
https://commitfest.postgresql.org/action/patch_view?id=351
but it seems too complex for me to apply all of the feature
at once, especially JSON-Path support. So, I'd like to submit
only basic and minimal JSON datatype support at first.

The most different point of my patch is that JSON parser is
reimplemented with flex and bison to make maintenance easier.

Note that the JSON parser accept top-level scalar values
intensionally, because of requirement when we add functions
to extract values from JSON array/object. For example,
CREATE FUNCTION json_to_array(json) RETURNS json[]
might return naked scalar values in the result array.

--
Itagaki Takahiro

Attachment Content-Type Size
basic_json-20100915.patch application/octet-stream 28.6 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2010-09-15 02:47:10 Re: elog during holding a spinlock is safe?
Previous Message Tom Lane 2010-09-15 02:30:46 Re: Pseudoconstant quals versus the join removal patch