Re: patch: Add JSON datatype to PostgreSQL (GSoC, WIP) - Mailing list pgsql-hackers

From Joseph Adams
Subject Re: patch: Add JSON datatype to PostgreSQL (GSoC, WIP)
Date
Msg-id AANLkTi=L1DDPQuzp9_zTe=76gmcSpVUnV6+-v_ObYWnj@mail.gmail.com
Whole thread Raw
In response to Re: patch: Add JSON datatype to PostgreSQL (GSoC, WIP)  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: patch: Add JSON datatype to PostgreSQL (GSoC, WIP)
Re: patch: Add JSON datatype to PostgreSQL (GSoC, WIP)
Re: patch: Add JSON datatype to PostgreSQL (GSoC, WIP)
Re: patch: Add JSON datatype to PostgreSQL (GSoC, WIP)
List pgsql-hackers
Update: I'm in the middle of cleaning up the JSON code (
http://git.postgresql.org/gitweb?p=json-datatype.git;a=summary if you
want to see the very latest ), so I haven't addressed all of the major
problems with it yet.

On Fri, Jul 23, 2010 at 2:34 PM, Robert Haas <robertmhaas@gmail.com> wrote:
> - I was under the impression that we wanted EXPLAIN (FORMAT JSON) to
> return type json, but that's obviously not going to be possible if all
> of this is contrib.  We could (a) move it all into core, (b) move the
> type itself and its input and output functions into core and leave the
> rest in contrib [or something along those lines], or (c) give up using
> it as the return type for EXPLAIN (FORMAT JSON).

I've been developing it as a contrib module because:
* I'd imagine it's easier than developing it as a built-in datatype
right away (e.g. editing a .sql.in file versus editing pg_type.h ).
* As a module, it has PGXS support, so people can try it out right
away rather than having to recompile PostgreSQL.

I, for one, think it would be great if the JSON datatype were all in
core :-)  However, if and how much JSON code should go into core is up
for discussion.  Thoughts, anyone?

A particularly useful aspect of the JSON support is the ability to
convert PostgreSQL arrays to JSON arrays (using to_json ), as there
currently isn't any streamlined way to parse arrays in the PostgreSQL
format client-side (that I know of).


Joey Adams


pgsql-hackers by date:

Previous
From: Mike Fowler
Date:
Subject: Re: [PATCH] Re: Adding XMLEXISTS to the grammar
Next
From: Andres Freund
Date:
Subject: Re: patch: Add JSON datatype to PostgreSQL (GSoC, WIP)