Re: machine-readable explain output v4 - Mailing list pgsql-hackers

From Andrew Dunstan
Subject Re: machine-readable explain output v4
Date
Msg-id 4A7F7C4F.2040305@dunslane.net
Whole thread Raw
In response to Re: machine-readable explain output v4  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers

Robert Haas wrote:
> One subtle point that isn't documented and probably should be is that
> JSON can't support a container that behaves partly like a list and
> partly like a hash, as XML can.  So for example in XML a <Plan> tag
> could have children like <Startup-Cost> (one each) and could also have
> its inner, outer, and sub-plans in there as <Plan> tags right under
> the parent <Plan>.  I'm not sure this would be good design anyway, but
> it COULD be done.  In JSON, this will crash and burn, because the
> container is either an array (which precludes labelling the elements)
> or a hash (which precludes duplicates).
>
>
>   

Right, this is fairly well known, I think. There are methods to map XML 
to JSON, and it can even be done in such a way that you can make a 
complete round trip, but in the schemes I've seen the JSON doesn't 
really look like what you would use if you designed the JSON document 
from scratch, or if it does then you're losing something.

cheers

andrew


pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: machine-readable explain output v4
Next
From: Robert Haas
Date:
Subject: Re: Issues for named/mixed function notation patch