pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: cherio@gmail.com
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #16091: xpath fails to compute "name()", regression
Date: Wed, 30 Oct 2019 14:10:26 -0400
Message-ID: <15301.1572459026@sss.pgh.pa.us> (raw)
In-Reply-To: <16091-a4296887079c549f@postgresql.org>
References: <16091-a4296887079c549f@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





view thread (3+ messages)  latest in thread

Message-ID: <15301.1572459026@sss.pgh.pa.us>
Permalink:  ../15301.1572459026@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/15301.1572459026@sss.pgh.pa.us

 · 

reply

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, cherio@gmail.com
  Subject: Re: BUG #16091: xpath fails to compute "name()", regression
  In-Reply-To: <15301.1572459026@sss.pgh.pa.us>
  References: <16091-a4296887079c549f@postgresql.org> <15301.1572459026@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