Re: BUG #16046: xpath returns CDATA tag along with the value in postgres 12 - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #16046: xpath returns CDATA tag along with the value in postgres 12
Date
Msg-id 10621.1571953091@sss.pgh.pa.us
Whole thread Raw
In response to BUG #16046: xpath returns CDATA tag along with the value in postgres 12  (PG Bug reporting form <noreply@postgresql.org>)
Responses Re: BUG #16046: xpath returns CDATA tag along with the value inpostgres 12
List pgsql-bugs
PG Bug reporting form <noreply@postgresql.org> writes:
> While using xpath to extract text from a CDATA section of xml, it returns
> CDATA tag along with the value.
>
> Query: SELECT unnest(xpath('//cname/aname/text()','<cname><aname><![CDATA[select 5]]></aname></cname>'::xml))
>
> Output - pg11: select 5
>
> Output - pg12: <![CDATA[select 5]]>

I haven't actually bisected to make sure, but I imagine this is a
consequence of commit 251cf2e27bec98274e8bb002608680bdc211319e.
What's not entirely clear to me is whether it's an intentional
effect, or a bug.  Authors, any comments?

            regards, tom lane



pgsql-bugs by date:

Previous
From: Andres Freund
Date:
Subject: Re: ERROR: subtransaction logged without previous top-level txnrecord
Next
From: Chapman Flack
Date:
Subject: Re: BUG #16046: xpath returns CDATA tag along with the value inpostgres 12