Re: xpath

From: Otandeka Simon Peter <sotandeka(at)gmail(dot)com>
To: Allan Kamau <kamauallan(at)gmail(dot)com>
Cc: Postgres General Postgres General <pgsql-general(at)postgresql(dot)org>
Subject: Re: xpath
Date: 2010-02-10 08:34:01
Message-ID: efc321cd1002100034v1682c10dubd9c5056243c41fc@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Allan,

Postgres is very strict on variable types and char conversion. I have a
feeling you are trying to access data from a varchar feild using an
integer...

Can you paste here your schema for that table?

P.

On Wed, Feb 10, 2010 at 11:06 AM, Allan Kamau <kamauallan(at)gmail(dot)com> wrote:

> 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.
>
> --
> Sent via pgsql-general mailing list (pgsql-general(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general
>

In response to

  • xpath at 2010-02-10 08:06:11 from Allan Kamau

Responses

  • Re: xpath at 2010-02-10 09:33:18 from Allan Kamau
  • Re: xpath at 2010-02-10 09:39:43 from Allan Kamau

Browse pgsql-general by date

  From Date Subject
Next Message John R Pierce 2010-02-10 08:47:25 Re: One column to multiple columns based on constraints?
Previous Message Carsten Kropf 2010-02-10 08:32:58 Extending SQL in C using VARIABLE length type