Re: PATCH: Add hstore_to_json()

Поиск
Список
Период
Сортировка
От Ron Mayer
Тема Re: PATCH: Add hstore_to_json()
Дата
Msg-id 4B2BF018.2050503@cheapcomplexdevices.com
обсуждение исходный текст
Ответ на Re: PATCH: Add hstore_to_json()  (Tom Lane <tgl@sss.pgh.pa.us>)
Список 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 по дате отправления:

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: PATCH: Add hstore_to_json()
Следующее
От: Tom Lane
Дата:
Сообщение: Re: snapshot tarball generation broken for -HEAD