Re: machine-readable explain output

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Bernd Helmle <mailings(at)oopsware(dot)de>, Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-hackers(at)postgresql(dot)org, Andrew Dunstan <andrew(at)dunslane(dot)net>, Josh Berkus <josh(at)agliodbs(dot)com>
Subject: Re: machine-readable explain output
Date: 2009-06-14 17:00:24
Message-ID: 603c8f070906141000i7d75f944t185e6b737f9af62@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sun, Jun 14, 2009 at 11:28 AM, Tom Lane<tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Robert Haas <robertmhaas(at)gmail(dot)com> writes:
>> On Sat, Jun 13, 2009 at 6:40 PM, Tom Lane<tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>>> 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.
>
> That's because the code goes through BuildTupleFromCStrings, which
> invokes xml_in in this scenario, and xml_in (as opposed to xml_out)
> does depend on libxml.
>
> However, using BuildTupleFromCStrings is wasteful/stupid for *both*
> text and xml output, so it seems like getting rid of it is the thing
> to do here.

Makes sense. However, if we just make that change in do_tup_output(),
then we'll break the ability to use that function for non-text
datatypes. Currently that doesn't look like a problem, because the
only clients are ShowGUCConfigOption(), do_text_output_oneline(), and
do_text_output_multiline(),

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2009-06-14 17:02:51 Re: machine-readable explain output
Previous Message Petr Jelinek 2009-06-14 15:59:58 Re: [GENERAL] Using results from DELETE ... RETURNING