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

From Chapman Flack
Subject Re: BUG #16046: xpath returns CDATA tag along with the value inpostgres 12
Date
Msg-id 5DB253C8.4020501@anastigmatix.net
Whole thread Raw
In response to Re: BUG #16046: xpath returns CDATA tag along with the value inpostgres 12  (Chapman Flack <chap@anastigmatix.net>)
Responses Re: BUG #16046: xpath returns CDATA tag along with the value in postgres 12  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
On 10/24/19 19:14, Chapman Flack wrote:

> Which may or may not be a good thing. Perhaps it could lead the unwary
> in some cases to think such a query is giving a directly usable
> text string back, which will be harmless until the one time a value
> with escaping comes back. (The no-surprises way to get back a directly
> usable text string, if that's what's wanted, would be with XMLTABLE
> and an output column of text type.)

If the original reporter is happy with getting xml back, instead of
raw text, but only wants the form of escaping to be the same as it was
in pg11, the xpath //cname/aname/text() can just be rewritten as
string(//cname/aname), which will lose any CDATA-ness and consistently
produce the form where individual characters are escaped, in 11 or 12.

I think.

Regards,
-Chap



pgsql-bugs by date:

Previous
From: Andres Freund
Date:
Subject: Re: BUG #16076: JIT causes huge delays in a complex query. jit=offsolves it.
Next
From: Yuri Astrakhan
Date:
Subject: Re: BUG #16076: JIT causes huge delays in a complex query. jit=offsolves it.