Re: auto_explain produces invalid JSON - Mailing list pgsql-hackers

From Tom Lane
Subject Re: auto_explain produces invalid JSON
Date
Msg-id 11187.1329149710@sss.pgh.pa.us
Whole thread Raw
In response to Re: auto_explain produces invalid JSON  (Andrew Dunstan <andrew@dunslane.net>)
Responses Re: auto_explain produces invalid JSON  (Andrew Dunstan <andrew@dunslane.net>)
List pgsql-hackers
[ sorry for ignoring this over the weekend --- I wasn't feeling very well ]

Andrew Dunstan <andrew@dunslane.net> writes:
> On 02/11/2012 03:22 PM, Tom Lane wrote:
>> I'm inclined to think that this is auto_explain's error, not that of
>> the core code, ie we should be changing the output.

> Well, maybe this is more to your taste, although it strikes me as more 
> than something of a kludge. At least it's short :-)

I see you've already committed this, but I agree that it's quite a
kluge.

After looking a bit more at the existing explain code, it seems like the
critical issue is that explain.c has ExplainOpenGroup/ExplainCloseGroup
calls around the ExplainPrintPlan call (see ExplainOnePlan), while
auto_explain does not.  I did not like your originally proposed patch
because it seemed to introduce yet another formatting concept into code
that has already got a few too many.  But couldn't we fix this by
exporting ExplainOpenGroup/ExplainCloseGroup and then calling those from
auto_explain?
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: When do we lose column names?
Next
From: Fujii Masao
Date:
Subject: Re: Scaling XLog insertion (was Re: Moving more work outside WALInsertLock)