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

From Tom Lane
Subject Re: PATCH: Add hstore_to_json()
Date
Msg-id 10429.1261166426@sss.pgh.pa.us
Whole thread Raw
In response to Re: PATCH: Add hstore_to_json()  (Alvaro Herrera <alvherre@commandprompt.com>)
Responses Re: PATCH: Add hstore_to_json()  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
Alvaro Herrera <alvherre@commandprompt.com> writes:
> Tom Lane escribi�:
>> 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?
>> (If so, this patch ought to be hstore_to_xml instead.)

> But then there's the matter of overhead: how much would be wasted by
> transforming to XML, and then parsing the XML back to transform to JSON?

Well, that would presumably happen only when sending data to or from the
client.  It's not obvious that it would be much more expensive than the
syntax checking you'd have to do anyway.

If there's some reason to think that operating on json data would be
much less expensive than operating on xml, there might be a case for
having two distinct sets of operations internally, but I haven't heard
anybody make that argument.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: PATCH: Add hstore_to_json()
Next
From: Dimitri Fontaine
Date:
Subject: Re: Backup history file should be replicated in Streaming Replication?