[xquery-talk] Extracting XML data from a Table in PosgreSQL

Michael Kay mike at saxonica.com
Thu Dec 27 10:53:03 PST 2007

>   I am a newbie to XQuery, and I currently use a PostgreSQL 
> database to store some of the data in my XML files to run the 
> search using XQuery.
>   It appears that I have to use some sort of collection() to 
> be able to connect my files to this particular database, and 
> from my past experience with SQL, different databases on 
> various  systems have different ways of connecting to it.

You asked this question before and no-one answered. This is probably because
there is no-one on the list who knows anything about XQuery support in
PostgreSQL. I strongly suspect that this is because there is no XQuery
support in PostgreSQL.

You can store XML as text in a pure relational database, but the only way to
get it out of a relational database is by using SQL. You might find a
third-party XQuery engine that can translate XQuery queries into SQL
queries, but I don't know of one that does this - the DataDirect engine,
which has this general architecture, will allow you to use XQuery against
data stored in relational form, but not (as far as I am aware) against XML
stored in a relational database as text.

Michael Kay

More information about the talk mailing list