Re: BUG #14151: Xml special symbols are not unescaped when gettting value of Xml via xpath

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: onic(at)live(dot)fr
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #14151: Xml special symbols are not unescaped when gettting value of Xml via xpath
Date: 2016-05-19 17:56:18
Message-ID: 32376.1463680578@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

onic(at)live(dot)fr writes:
> SELECT unnest(xpath('/name/text()', xmlelement(name name, 'AT&T', null )))
> This gives me 'AT&amp;T' and

AFAICS, that behavior is correct. xpath returns a value of type xml
(well, really xml[]) and 'AT&T' is not a legal value of that type;
only 'AT&amp;T' is.

> I have NO WAY inside pgsql to get 'At&t' value

I agree that there ought to be an "unescape" function that would convert
this back to 'AT&T', but the lack of one seems like a missing feature not
a bug. I'd wonder for example what an unescape function ought to do with
other markup such as '<name>'.

The last concrete discussion we had on this seems to have been
this thread:

http://www.postgresql.org/message-id/flat/C71079E6-12D8-4048-B8C5-18368936FD5D(at)phlo(dot)org

which petered out for lack of anyone finding the time to investigate
the relevant standards.

regards, tom lane

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message David G. Johnston 2016-05-19 19:06:13 Re: BUG #14151: Xml special symbols are not unescaped when gettting value of Xml via xpath
Previous Message onic 2016-05-19 15:00:37 BUG #14151: Xml special symbols are not unescaped when gettting value of Xml via xpath