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

From Craig Ringer
Subject Re: patch: Add JSON datatype to PostgreSQL (GSoC, WIP)
Date
Msg-id 4C95D3BB.5070302@postnewspapers.com.au
Whole thread Raw
In response to Re: patch: Add JSON datatype to PostgreSQL (GSoC, WIP)  (David Fetter <david@fetter.org>)
List pgsql-hackers
On 08/12/2010 06:27 AM, David Fetter wrote:

> +1 for putting it in core in 9.1 :)

There are times I really wish I could get object graphs, or at least 
hierarchically nested object trees, of objects matching various 
criteria. JSON might be a reasonable representation, and one that's 
increasingly well supported by many different clients. Having it core 
would be really handy for that sort of use, especially as managing 
contrib modules is rather far from ideal in Pg as things stand.

Using the usual generic business app example, it'd be good to be able to 
retrieve "customer 1234, as well as all dependent records in Invoices 
and Addresses" with one query, one round trip ... and no horrid ORM-like 
use of left outer joins plus post-processing.

I've been able to do that with nested XML representations, but it's a 
remarkably verbose, bulky way to move chunks of data around.

This patch already looks like it has lots of promise for that sort of 
use. It'd need aggregates, but that's already come up. A 
composite-or-row-type to json converter seems to be much of the point of 
this patch, and that's the only other part that's really required. So 
I'm excited, and I suspect I won't be the only one.

I'm grabbing it to start playing with it now. I just wanted to chime in 
with interest + enthusiasm for JSON as an increasingly useful 
representation.

--
Craig Ringer


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Postgres 9.0.0 release scheduled
Next
From: Kevin Grittner
Date:
Subject: Re: Serializable Snapshot Isolation