Re: [PATCHES] Explain XML patch v2

From: Tom Raney <raneyt(at)cecs(dot)pdx(dot)edu>
To: daveg <daveg(at)sonic(dot)net>
Cc: David Fetter <david(at)fetter(dot)org>, Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-patches(at)postgresql(dot)org, Gregory Stark <stark(at)enterprisedb(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: [PATCHES] Explain XML patch v2
Date: 2008-07-04 07:07:49
Message-ID: 20080704000749.motuh47huog884cs@webmail.cecs.pdx.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

Quoting daveg <daveg(at)sonic(dot)net>:

> On Wed, Jul 02, 2008 at 09:01:18AM -0700, David Fetter wrote:
>> On Wed, Jul 02, 2008 at 05:57:29PM +0200, Peter Eisentraut wrote:
>> > It would also be interesting if EXPLAIN could optionally be a
>> > function that returns a datum of type XML, to allow further
>> > processing.
>>
>> It would be better to have a function which allows people to plug in
>> their own serialization. A JSON or YAML one, for example, would be
>> much lighter weight on both ends.
>
> +1 for either of these.
>
> -dg
>

So, this leads me to the idea of assembling the EXPLAIN data
internally in an output-neutral data structure. At the very end of
processing, one decision statement would decide which output plugin to
use for output. Sprinkling XML print statements throughout the code
(as currently done in the patch) while functional, is not ideal. And,
the escaping of XML content should ideally be done in the serializer
anyway.

Of course, this realization didn't occur to me until *after* I had
spent a bit of time coding up the patch in its current form. Oh well.

Thoughts?

Regarding the XML datum, in order to support that, will all users need
to compile with libxml? Are there any lighter weight solutions to
serialize other than libxml?

-Tom Raney

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Heikki Linnakangas 2008-07-04 07:32:32 Re: gsoc, text search selectivity and dllist enhancments
Previous Message Andrew Hammond 2008-07-04 05:57:36 Re: the un-vacuumable table

Browse pgsql-patches by date

  From Date Subject
Next Message Zdenek Kotala 2008-07-04 07:31:29 Re: page macros cleanup
Previous Message Mark Kirkwood 2008-07-04 03:23:51 Re: Relation forks & FSM rewrite patches