Re: PATCH: Add hstore_to_json() - Mailing list pgsql-hackers

From Ron Mayer
Subject Re: PATCH: Add hstore_to_json()
Date
Msg-id 4B2BF018.2050503@cheapcomplexdevices.com
Whole thread Raw
In response to Re: PATCH: Add hstore_to_json()  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
+1 for such a feature, simply to avoid the need of
writing a hstore-parser (which wasn't too bad
to write, but it felt unnecessary).   Doesn't
matter to me if it's hstore-to-json or hstore-to-xml
or hstore-to-yaml.  Just something that parsers are
readily available for.

Heck, I wouldn't mind if hstore moved to using any one
of those for it's external representations by default.

Tom Lane wrote:
> a ton of special syntax for xml support, ...a json type...
> [ I can already hear somebody insisting on a yaml type :-( ]

If these were CPAN-like installable modules, I'd hope
there would be eventually.  Don't most languages and
platforms have both YAML and JSON libraries?  Yaml's
user-defined types are an example of where this might
be useful eventually.

Tom Lane wrote:
> Well, actually, now that you mention it: how much of a json type would
> be duplicative of the xml stuff?  Would it be sufficient to provide
> json <-> xml converters and let the latter type do all the heavy lifting?

I imagine eventually a JSON type could validate fields using
JSON Schema.   But that's drifting away from hstore.

> (If so, this patch ought to be hstore_to_xml instead.)

Doesn't matter to me so long as it's any format with readily
available parsers.





pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: PATCH: Add hstore_to_json()
Next
From: Tom Lane
Date:
Subject: Re: snapshot tarball generation broken for -HEAD