RE: BUG #15908: Xpath operations fail

From: Rick Vincent <rvincent(at)temenos(dot)com>
To: Daniel Gustafsson <daniel(at)yesql(dot)se>
Cc: Herve Aubert <haubert(at)temenos(dot)com>, PostgreSQL mailing lists <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: RE: BUG #15908: Xpath operations fail
Date: 2019-07-18 13:46:21
Message-ID: MN2PR04MB5806F536B63C3A9A2CA5A1BCC1C80@MN2PR04MB5806.namprd04.prod.outlook.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Hi Daniel,

Thanks for your reply. I believe all of the major database vendors support it as we implement them all (Oracle, DB2, SQLServer)...or at least their operators >,>=, etc work with XMLExists and do text compares and don't convert any text to decimal. Do you have an answer why XMLExists always seems to be returning true, ie. the last query I sent?

T24=# SELECT xpath('/row/c1', xmlrecord) as c1, xpath('/row/c2', t.xmlrecord) as c2, xpath('/row/c2[(at)m="2"]/text() = ''A''',t.xmlrecord) VAL, xmlexists('/row/c2[(at)m="2"]/text() = ''A''' PASSING t.xmlrecord) xmlex FROM test t;
c1 | c2 | val | xmlex
--------------------+--------------------------------------+---------+-------
{<c1>Manual</c1>} | {<c2>1</c2>,"<c2 m=\"2\">2</c2>"} | {false} | t
{<c1>Apropos</c1>} | {<c2>1</c2>,"<c2 m=\"2\">2</c2>"} | {false} | t
{<c1>Bprop</c1>} | {<c2>1</c2>,"<c2 m=\"2\">3</c2>"} | {false} | t
{<c1>Bprop</c1>} | {<c2>1</c2>,"<c2 m=\"2\">4</c2>"} | {false} | t
{<c1>Dprop</c1>} | {<c2>1</c2>,"<c2 m=\"2\">A</c2>"} | {true} | t
{<c1>Eprop</c1>} | {<c2>1</c2>,"<c2 m=\"2\">D</c2>"} | {false} | t
{<c1>Fprop</c1>} | {<c2>1</c2>,"<c2 m=\"2\">test</c2>"} | {false} | t
(7 rows)

Big thanks,
Rick
-----Original Message-----
From: Daniel Gustafsson <daniel(at)yesql(dot)se>
Sent: Thursday, July 18, 2019 3:06 PM
To: Rick Vincent <rvincent(at)temenos(dot)com>
Cc: Herve Aubert <haubert(at)temenos(dot)com>; PostgreSQL mailing lists <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: Re: BUG #15908: Xpath operations fail

> On 18 Jul 2019, at 11:48, Rick Vincent <rvincent(at)temenos(dot)com> wrote:

> Thanks. It explains why ends-with doesn't work either. I don't suppose XPath 2.0 version is supported or will be supported?

I haven’t heard of anyone working on that, and it seems unlikely to happen within the near future as few, if any, libraries support XPath 2.0 (or later).

cheers ./daniel

The information in this e-mail and any attachments is confidential and may be legally privileged. It is intended solely for the addressee or addressees. Any use or disclosure of the contents of this e-mail/attachments by a not intended recipient is unauthorized and may be unlawful. If you have received this e-mail in error please notify the sender. Please note that any views or opinions presented in this e-mail are solely those of the author and do not necessarily represent those of TEMENOS. We recommend that you check this e-mail and any attachments against viruses. TEMENOS accepts no liability for any damage caused by any malicious code or virus transmitted by this e-mail.

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Pavel Stehule 2019-07-18 14:15:57 Re: BUG #15908: Xpath operations fail
Previous Message Daniel Gustafsson 2019-07-18 13:06:18 Re: BUG #15908: Xpath operations fail