Re: PATCH: Add hstore_to_json()
Andrew Dunstan <andrew@dunslane.net>
From: Andrew Dunstan <andrew@dunslane.net>
To: Peter Eisentraut <peter_e@gmx.net>
Cc: "David E. Wheeler" <david@kineticode.com>, Robert Haas <robertmhaas@gmail.com>, PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Date: 2010-01-01T22:19:24Z
Lists: pgsql-hackers
Peter Eisentraut wrote: >> IMNSHO it's essential. I think Peter's approach of ignoring this >> requirement is extremely shortsighted. >> > > Whose requirement is it? I'm not ignoring it, but so far no one has > actually said that it is a requirement and why. > > 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? In general we have adopted an approach that allows for a very rich type system, with a substantial set of manipulator functions for almost all types. That's one of the things I find attractive about Postgres, so I think we should stick to it in this instance. cheers andrew