0

I'm trying to decode the URL characters such as "&amp" to "&", I found the code works in PostgreSQL - Replace HTML Entities . The code is (xpath('/z/text()', ('<z>' || 'AT&amp;T' || '</z>')::xml))[1] as output.

I try to understand this code and read the document of it, but the only thing I found is the explanation of xpath(xpath, xml [, nsarray]). I'm a freshman on PostgreSQL, and I know the /z/ is like a tag. But what is the "||","1" means? why should it use '/z/text()'.

If there have some links about that, it will very helpful. Thanks a lot.

Meilan
  • 434
  • 6
  • 17

0 Answers0