Fix XMLTABLE() deparsing to quote namespace names if necessary.
authorDean Rasheed <[email protected]>
Sun, 12 Jan 2025 13:02:56 +0000 (13:02 +0000)
committerDean Rasheed <[email protected]>
Sun, 12 Jan 2025 13:02:56 +0000 (13:02 +0000)
commit8f137f0382b1ed1cb015ad12d36a6398b89a5e5f
tree1535f5c58ed99a16f3024e8b9d818e23a181a32c
parent02a38bc84befa2858fbff65fd9cb46b640d5abd2
Fix XMLTABLE() deparsing to quote namespace names if necessary.

When deparsing an XMLTABLE() expression, XML namespace names were not
quoted. However, since they are parsed as ColLabel tokens, some names
require double quotes to ensure that they are properly interpreted.
Fix by using quote_identifier() in the deparsing code.

Back-patch to all supported versions.

Dean Rasheed, reviewed by Tom Lane.

Discussion: https://postgr.es/m/CAEZATCXTpAS%3DncfLNTZ7YS6O5puHeLg_SUYAit%2Bcs7wsrd9Msg%40mail.gmail.com
src/backend/utils/adt/ruleutils.c
src/test/regress/expected/xml.out
src/test/regress/expected/xml_1.out
src/test/regress/expected/xml_2.out
src/test/regress/sql/xml.sql