Re: PATCH: Add hstore_to_json()

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: "David E(dot) Wheeler" <david(at)kineticode(dot)com>, 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 01:04:10
Message-ID: 1262480650.3542.14.camel@vanquo.pezone.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On fre, 2010-01-01 at 17:19 -0500, Andrew Dunstan wrote:
> Mine for one :-). Quite apart from any other reason I would expect it to
> make indexing parts of the JSON more tractable. Say we use it to store a
> web session object, which is a natural enough use. I might well want to
> find or modify sessions with certain characteristics. I'm sure I
> wouldn't be the only possible usewr who would want something
> substantially more of such a type than just being able to validate it.
> We have XPath for XML. and a substantial accessor API for hstore, so why
> would we want anything less for JSON?

Well, because they are not the same. XML is a tree structure (and the
XPath-SQL integration is already pretty weird), hstore is a set of
key/value pairs, JSON is, supposedly, an object, which doesn't map very
well to SQL.

Of course you could invent an API for JSON, but that doesn't mean it is
necessary for a JSON type to exist, if you have PL/Perl and PL/Python as
much better object-oriented APIs already available.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2010-01-03 01:21:35 So do we really *need* those substring() ops in tab-completion queries?
Previous Message Tom Lane 2010-01-03 00:47:22 Re: psql tab completion for DO blocks