From: | Allan Kamau <kamauallan(at)gmail(dot)com> |
---|---|
To: | Postgres General Postgres General <pgsql-general(at)postgresql(dot)org> |
Subject: | xpath |
Date: | 2010-02-10 08:06:11 |
Message-ID: | ab1ea6541002100006s6ed18a0r383e66869c6e37d7@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Hi,
I am running postgreSQL-8.4.2. I have a table that stores a single xml
document per row in one of it's fields. I would like to use xpath to
retrieve portions of these xml documents.
Is there a way to do so. (I am running postgreSQL 8.4.2 configured
(built) with --with-libxml and --with-libxslt options)
I have looked at 'xpath' but I am unable to get it work for table fields.
The command below works.
SELECT xpath('/doc/name/@first','<doc><name first="David"
last="Marston"/>...</doc>');
The command below seems not to execute successfully
SELECT a.id,xpath('/doc/name/@first',a.xml_payload) FROM
staging.simple_table a WHERE a.id=1;
HINT: No function matches the given name and argument types. You
might need to add explicit type casts.
Allan.
From | Date | Subject | |
---|---|---|---|
Next Message | Davor J. | 2010-02-10 08:15:20 | Re: R: One column to multiple columns based on constraints? |
Previous Message | Andy Dale | 2010-02-10 07:52:55 | Re: logging statements from hibernate to valid SQL |