Re: returning PGresult as xml

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Brian Moore <brianmooreca(at)yahoo(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: returning PGresult as xml
Date: 2004-01-25 17:23:33
Message-ID: 200401251823.33826.peter_e@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Brian Moore wrote:
> i feel badly that i have not been able to use any existing
> standards. xmlrpc, i found, was not type-rich enough, and that made
> it difficult or impossible to use. in particular, the only way to
> represent a matrix is as a struct of structs. this makes it very
> verbose for one to encode a PGresult. i found SOAP too difficult for
> compliance. so my result was to create a schema, which results in a
> DTD.

Let me point out an implementation I made last time this subject was
discussed:

http://developer.postgresql.org/~petere/xmltable.tar.bz2

This package contains server-side functions that convert a table (more
generally a query result) to an XML document and/or and XSL schema both
mimicking the SQL/XML standard.

Additionally, it contains a function to convert such an XML document
back to a table source. I also threw in an XSLT stylesheet to convert
an SQL/XML table to an HTML table, so you can more easily view the
results.

I also have some code in development that adds cursor interfaces, an XML
data type, and some integration with the existing XPath functionality.
I think that for processing XML in the database and as far as following
the existing standards, this is the direction to take.

Also last time this subject was dicussed, I believe it was Mike Mascari
who proposed and implemented another solution which is more client-side
oriented. He wrote a piece of code that took a normal libpq result set
and shipped it off as SQL/XML wrapped in SOAP. And it had streaming
capabilities for large result sets.

These are two complementary approaches that exist more or less. Of
course this only covers the C API and would need sensible extensions
for other programming langauges. But I invite you to look at them and
see whether they fit your needs (the ideas, not necessarily the state
of the code).

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Greg Stark 2004-01-25 17:38:28 Re: Named arguments in function calls
Previous Message Hannu Krosing 2004-01-25 16:24:03 Re: returning PGresult as xml