Re: possible bug in xpath function - Mailing list pgsql-bugs

From Tom Lane
Subject Re: possible bug in xpath function
Date
Msg-id 877002.1647013995@sss.pgh.pa.us
Whole thread Raw
Responses Re: possible bug in xpath function  (Andrey Kapliev <a.kapliev@gmail.com>)
List pgsql-bugs
Andrey Kapliev <a.kapliev@gmail.com> writes:
> It looks like XPATH name() function called from xpath() PostgreSQL
> function behave differently than when called from XMLTABLE()
> PATH.

Your examples are by no means equivalent: in particular the XMLTABLE
example is using an absolute path //* while the xpath example
is implicitly using a relative path.

> This
> behavior is different from that of 9.6 version where xpath correctly
> returns names of the nodes.

I think this was an intentional change in v11.  The 11.0 release
notes mention

  * Correctly handle relative path expressions in xmltable(), xpath(), and
    other XML-handling functions (Markus Winand)

    Per the SQL standard, relative paths start from the document node of
    the XML input document, not the root node as these functions
    previously did.

            regards, tom lane



pgsql-bugs by date:

Previous
From: Masahiko Sawada
Date:
Subject: Re: BUG #17385: "RESET transaction_isolation" inside serializable transaction causes Assert at the transaction end
Next
From: Andrey Kapliev
Date:
Subject: Re: possible bug in xpath function