Re: PATCH: Add hstore_to_json()

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: "David E(dot) Wheeler" <david(at)kineticode(dot)com>
Cc: Hitoshi Harada <umi(dot)tanuki(at)gmail(dot)com>, Peter Eisentraut <peter_e(at)gmx(dot)net>, Robert Haas <robertmhaas(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: PATCH: Add hstore_to_json()
Date: 2010-01-03 19:40:02
Message-ID: 4B40F292.5040809@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2010-01-03 19:54:53 Re: invalid UTF-8 via pl/perl
Previous Message Magnus Hagander 2010-01-03 19:13:28 Re: win32 socket definition