The following bug has been logged online:
Bug reference: 4822
Logged by: Itagaki Takahiro
Email address: itagaki.takahiro@oss.ntt.co.jp
PostgreSQL version: 8.4dev
Operating system: Linux, Windows
Description: xmlattributes encodes '&' twice
Details:
=# SELECT xmlelement(name a, xmlattributes('./qa?a=1&b=2' as href), 'Q&A');
xmlelement
--------------------------------------------
<a href="./qa?a=1&b=2">Q&A</a>
(1 row)
'&' in xmlattributes seems to be encoded twice.
( '&' => '&' => '&' )
The bug only exists in 8.4dev;
PostgreSQL 8.3 correctly encodes '&' only once.