Re: PATCH: Add hstore_to_json() - Mailing list pgsql-hackers

From Andrew Dunstan
Subject Re: PATCH: Add hstore_to_json()
Date
Msg-id 4B40F292.5040809@dunslane.net
Whole thread Raw
In response to Re: PATCH: Add hstore_to_json()  ("David E. Wheeler" <david@kineticode.com>)
Responses Re: PATCH: Add hstore_to_json()  ("David E. Wheeler" <david@kineticode.com>)
List pgsql-hackers

David E. Wheeler wrote:
> On Jan 3, 2010, at 8:00 AM, Andrew Dunstan wrote:
>
>   
>> I think the minimal functionality I'd want is:
>>
>>   convert record to JSON
>>   convert JSON to record
>>     
>
> With caveats as to dealing with nested structures (can a record be an attribute of a record?).
>   


We allow composites as fields. The biggest mismatch in the type model is 
probably w.r.t arrays. JSON arrays can be heterogenous and 
non-rectangular, AIUI.


>   
>>   extract a value, or set of values, from JSON
>>   composition of JSON
>>     
>
> There's a lot of functionality in hstore that I'd like to see. It'd make sense to use the same operators for the same
operations.I think I'd start with hstore as a basic spec.
 
>
>
>   

OK, but hstores are flat, unlike JSON. We need some way to do the 
equivalent of xpath along the child axis and without predicate tests. 
hstore has no real equivalent because it has no nesting.

cheers

andrew


pgsql-hackers by date:

Previous
From: Magnus Hagander
Date:
Subject: Re: win32 socket definition
Next
From: Andrew Dunstan
Date:
Subject: Re: invalid UTF-8 via pl/perl