Re: PATCH: Add hstore_to_json()

Andrew Dunstan <andrew@dunslane.net>

From: Andrew Dunstan <andrew@dunslane.net>
To: Hitoshi Harada <umi.tanuki@gmail.com>
Cc: "David E. Wheeler" <david@kineticode.com>, Peter Eisentraut <peter_e@gmx.net>, Robert Haas <robertmhaas@gmail.com>, PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Date: 2010-01-04T00:30:05Z
Lists: pgsql-hackers

Hitoshi Harada wrote:
> 2010/1/4 David E. Wheeler <david@kineticode.com>:
>   
>> On Jan 3, 2010, at 11:40 AM, Andrew Dunstan wrote:
>>
>>     
>>> 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.
>>>       
>> Cool, that sounds right.
>>     
>
> Does it mean you should create composite type to create anonymous JSON?
>
>   


No, not in the least. We should still store JSON as text. We should 
simply be able to convert a JSON value to a record of an existing type 
(providing it has the right shape) and a record (of any shape) to JSON.

cheers

andrew