From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andrey Kapliev <a.kapliev@gmail.com>
Cc: pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>
Subject: Re: possible bug in xpath function
Date: Fri, 11 Mar 2022 10:53:15 -0500
Message-ID: <877002.1647013995@sss.pgh.pa.us> (raw)
In-Reply-To: <E8D6C9E4-19DD-494E-AB34-7177C33F4168@hxcore.ol>
References: <951FB44B-9C6A-4147-AE9A-796360B72FD5@hxcore.ol>
<E8D6C9E4-19DD-494E-AB34-7177C33F4168@hxcore.ol>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-bugs@postgresql.org
Cc: tgl@sss.pgh.pa.us, a.kapliev@gmail.com, pgsql-bugs@lists.postgresql.org
Subject: Re: possible bug in xpath function
In-Reply-To: <877002.1647013995@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox