Re: PATCH: Add hstore_to_json()

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: "David E(dot) Wheeler" <david(at)kineticode(dot)com>, Peter Eisentraut <peter_e(at)gmx(dot)net>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: PATCH: Add hstore_to_json()
Date: 2009-12-31 21:28:41
Message-ID: 603c8f070912311328r6348f03bj573d6c8ed42be9f0@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Dec 31, 2009 at 11:12 AM, Andrew Dunstan <andrew(at)dunslane(dot)net> wrote:
> David E. Wheeler wrote:
>> On Dec 31, 2009, at 1:04 AM, Peter Eisentraut wrote:
>>>
>>> I think the primary use will be to load a JSON value into Perl or Python
>>> and process it there.  So a json type that doesn't have any interesting
>>> operators doesn't sound useless to me.  The features I would like to get
>>> out of it are input validation and encoding handling and smooth
>>> integration with said languages.
>>>
>>
>> What about access to various parts of a JSON data structure? Or is that
>> just asking for too much trouble up-front?
>
> IMNSHO it's essential. I think Peter's approach of ignoring this requirement
> is extremely shortsighted.

I could go either way on this. As a practical matter, we probably
shouldn't pick a library that is only a validator without any ability
to manipulate the data structure. And as a further practical matter,
that done, it's probably not that much work to expose whatever other
functionality that library provides. But I would not go to the extent
of saying that we should try to figure out from first principles what
functionality we want to include and then make it a requirement that
the chosen library must support all of those things. That seems like
a recipe for failure...

Anyhow, that brings me back to the question I asked upthread, which is
"Can/should we suck one of these libraries into our code base (and if
so, which?) or do we need to add an analogue of --with-libxml so that
we can link against an external library if present and omit the
feature otherwise?".

Does anyone have any real-world experience with any of the JSON C libraries?

...Robert

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Simon Riggs 2009-12-31 21:29:48 Re: Thoughts on statistics for continuously advancing columns
Previous Message Robert Haas 2009-12-31 21:19:11 Re: Red-black tree for GIN