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

From Robert Haas
Subject Re: machine-readable explain output
Date
Msg-id 603c8f070906131623l5394f7bdv3ef8cc619bb319dc@mail.gmail.com
Whole thread Raw
In response to Re: machine-readable explain output  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: machine-readable explain output  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: machine-readable explain output  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Sat, Jun 13, 2009 at 6:40 PM, Tom Lane<tgl@sss.pgh.pa.us> wrote:
> Bernd Helmle <mailings@oopsware.de> writes:
>> --On 13. Juni 2009 15:01:43 -0400 Robert Haas <robertmhaas@gmail.com> wrote:
>>>> Also, the result type of an EXPLAIN (format xml) should be type xml, not
>>>> text.
>>>
>>> Seems reasonable.  I'll see if I can figure out how to do that.
>
>> I suppose it's okay then, that the format is not available when the server
>> isn't build with --with-libxml ?
>
> I believe we have things set up so that you can still print "xml" data
> without libxml configured in.  We'd need to be sure casting to text
> works too, but other than that I don't see an issue here.

Hmm, I just tried to do this by modifying ExplainResultDesc to use
XMLOID rather than TEXTOID when stmt->format == EXPLAIN_FORMAT_XML,
and sure enough, explain (format xml) ... fails when --with-libxml is
not specified.  But maybe that's not the right way to do it - now that
I think about it, using that in combination with
do_text_output_multiline() seems totally wrong even if we end up
deciding not to worry about the output type, since while there are
multiple rows when the output is considered as text, there is surely
only one row when you look at the whole thing as an XML document.  I'm
not too sure how to do this though.  Help?

In any event, considering that EXPLAIN is a utility statement and
can't be embedded within a query, I'm not sure what benefit we get out
of returning the data as XML rather than text.  This doesn't seem
likely to change either, based on Tom's comments here.

http://archives.postgresql.org/pgsql-hackers/2009-05/msg00969.php

...Robert


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: machine-readable explain output
Next
From: Tom Lane
Date:
Subject: Re: machine-readable explain output