Re: auto_explain produces invalid JSON

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: auto_explain produces invalid JSON
Date: 2012-02-13 17:42:46
Message-ID: 4F394B96.808@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 02/13/2012 11:15 AM, Tom Lane wrote:
> [ sorry for ignoring this over the weekend --- I wasn't feeling very well ]
>
> Andrew Dunstan<andrew(at)dunslane(dot)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?

Yeah, maybe. We'd still have to do it conditionally (have to use
ExplainBeginOutput for the XML case), but it would possibly be less kludgy.

cheers

andrew

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2012-02-13 17:48:52 Re: auto_explain produces invalid JSON
Previous Message David E. Wheeler 2012-02-13 17:40:02 Re: Access Error Details from PL/pgSQL