On Sat, Jun 13, 2009 at 6:40 PM, Tom Lane<t...@sss.pgh.pa.us> wrote: > Bernd Helmle <maili...@oopsware.de> writes: >> --On 13. Juni 2009 15:01:43 -0400 Robert Haas <robertmh...@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 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers