pg.ddx.io pgsql-bugs@postgresql.org mailing list archive
help / color / mirror / Atom feedBUG #16091: xpath fails to compute "name()", regression
3+ messages / 3 participants
[nested] [flat]
* BUG #16091: xpath fails to compute "name()", regression
@ 2019-10-30 16:58 PG Bug reporting form <noreply@postgresql.org>
0 siblings, 1 reply; 3+ messages in thread
From: PG Bug reporting form @ 2019-10-30 16:58 UTC (permalink / raw)
To: pgsql-bugs@lists.postgresql.org; +Cc: cherio@gmail.com
The following bug has been logged on the website:
Bug reference: 16091
Logged by: Yuri Cherio
Email address: cherio@gmail.com
PostgreSQL version: 12.0
Operating system: Ubuntu Linux 18.04
Description:
After upgrading postgresql from 9 to 12 the following statement no longer
produces the same result: SELECT xpath('name()', '<abc>xyz</abc>'::XML)
PostgreSQL 9 returns '{abc}'
PostgreSQL 12 returns '{""}'
This behavior changed in version 11 and perpetuated into 12.
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: BUG #16091: xpath fails to compute "name()", regression
@ 2019-10-30 18:10 Tom Lane <tgl@sss.pgh.pa.us>
parent: PG Bug reporting form <noreply@postgresql.org>
0 siblings, 1 reply; 3+ messages in thread
From: Tom Lane @ 2019-10-30 18:10 UTC (permalink / raw)
To: cherio@gmail.com; +Cc: pgsql-bugs@lists.postgresql.org
PG Bug reporting form <noreply@postgresql.org> writes:
> After upgrading postgresql from 9 to 12 the following statement no longer
> produces the same result: SELECT xpath('name()', '<abc>xyz</abc>'::XML)
> PostgreSQL 9 returns '{abc}'
> PostgreSQL 12 returns '{""}'
> This behavior changed in version 11 and perpetuated into 12.
This looks to me to be an intentional change in xpath's behavior.
The v11 release notes call out the incompatibility:
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.
Perhaps 'name(/*)' would do what you want now.
regards, tom lane
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: BUG #16091: xpath fails to compute "name()", regression
@ 2019-10-30 20:08 Cherio <cherio@gmail.com>
parent: Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 0 replies; 3+ messages in thread
From: Cherio @ 2019-10-30 20:08 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-bugs@lists.postgresql.org
Thanks Tom,
This is what we essentially did to make the old code work.
I guess you are saying this is not considered a regression.
Than this is not a bug.
On Wed, Oct 30, 2019 at 2:10 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
> PG Bug reporting form <noreply@postgresql.org> writes:
> > After upgrading postgresql from 9 to 12 the following statement no longer
> > produces the same result: SELECT xpath('name()', '<abc>xyz</abc>'::XML)
>
> > PostgreSQL 9 returns '{abc}'
> > PostgreSQL 12 returns '{""}'
>
> > This behavior changed in version 11 and perpetuated into 12.
>
> This looks to me to be an intentional change in xpath's behavior.
> The v11 release notes call out the incompatibility:
>
> 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.
>
> Perhaps 'name(/*)' would do what you want now.
>
> regards, tom lane
>
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2019-10-30 20:08 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2019-10-30 16:58 BUG #16091: xpath fails to compute "name()", regression PG Bug reporting form <noreply@postgresql.org>
2019-10-30 18:10 ` Tom Lane <tgl@sss.pgh.pa.us>
2019-10-30 20:08 ` Cherio <cherio@gmail.com>
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