postgresql/src
Michael Paquier 1d8c72b2ef Fix handling of namespace nodes in xpath() (xml)
xpath() attempted to call xmlCopyNode() and xmlNodeDump() on a
XML_NAMESPACE_DECL, finishing with a confusing error:
=# SELECT xpath('//namespace::foo', '<root xmlns:foo="http://127.0.0.1"/>');
ERROR:  53200: could not copy node
CONTEXT:  SQL function "xpath" statement 1

xpath() is changed so as it goes through xmlXPathCastNodeToString()
instead, that is able to handle namespace nodes.  xml2 uses the same
solution.  This issue has been discovered while digging into
9d33a5a804.

Author: Michael Paquier <michael@paquier.xyz>
Discussion: https://postgr.es/m/aioT7ui_ZJ9RMlfM@paquier.xyz
Backpatch-through: 14
2026-06-12 10:25:54 +09:00
..
backend Fix handling of namespace nodes in xpath() (xml) 2026-06-12 10:25:54 +09:00
bin pg_recvlogical: Honor source cluster file permissions for output files 2026-05-20 15:57:14 +09:00
common Fix off-by-one with NFC recomposition for Hangul U+11A7 (TBASE) 2026-06-05 07:50:16 +09:00
fe_utils psql: Fix expanded aligned output 2026-06-08 14:38:00 +09:00
include Fix missed checks for hashability of container-type equality. 2026-06-08 11:48:18 -04:00
interfaces ecpg: Reject multiple header items in GET/SET DESCRIPTOR 2026-06-08 17:14:15 +09:00
makefiles Refactor DLSUFFIX handling 2022-03-25 08:56:02 +01:00
pl Make plpgsql_trap test more robust and less resource-intensive. 2026-04-21 10:54:39 -04:00
port Prevent path traversal in pg_basebackup and pg_rewind 2026-05-11 05:13:50 -07:00
template On NetBSD, force dynamic symbol resolution at postmaster start. 2022-08-30 17:28:55 -04:00
test Fix handling of namespace nodes in xpath() (xml) 2026-06-12 10:25:54 +09:00
timezone Guard against unsafe conditions in usage of pg_strftime(). 2026-05-11 05:13:50 -07:00
tools Add timingsafe_bcmp(), for constant-time memory comparison 2026-05-11 05:13:50 -07:00
tutorial Doc: sync src/tutorial/basics.source with SGML documentation. 2022-11-19 13:09:14 -05:00
.gitignore
DEVELOPERS
Makefile
Makefile.global.in Don't put library-supplied -L/-I switches before user-supplied ones. 2025-07-29 15:17:41 -04:00
Makefile.shlib Stop using "-multiply_defined suppress" on macOS. 2023-09-26 21:06:21 -04:00
nls-global.mk Fix update-po for the PGXS case 2025-10-16 20:21:05 +02:00