pgsql: Fix XMLTABLE() deparsing to quote namespace names if necessary.

From: Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Fix XMLTABLE() deparsing to quote namespace names if necessary.
Date: 2025-01-12 13:05:51
Message-ID: E1tWxf5-00195V-5F@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

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

Branch
------
REL_13_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/8f137f0382b1ed1cb015ad12d36a6398b89a5e5f

Modified Files
--------------
src/backend/utils/adt/ruleutils.c | 3 ++-
src/test/regress/expected/xml.out | 10 +++++++---
src/test/regress/expected/xml_1.out | 8 +++++---
src/test/regress/expected/xml_2.out | 10 +++++++---
src/test/regress/sql/xml.sql | 8 +++++---
5 files changed, 26 insertions(+), 13 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Dean Rasheed 2025-01-12 13:39:38 pgsql: Fix JsonExpr deparsing to quote variable names in the PASSING cl
Previous Message Tom Lane 2025-01-11 16:46:22 pgsql: Repair memory leaks in plpython.