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

d673eefd410cd7f5f95e418990146189f44811af
m3hm3t/pg18_dev_relation_oid_0
Mehmet Yilmaz 2025-05-30 08:58:09 +00:00
parent 0280fd7272
commit 5bb635ab6c
1 changed files with 4 additions and 3 deletions

View File

@ -8382,17 +8382,18 @@ get_xmltable(TableFunc *tf, deparse_context *context, bool showimplicit)
forboth(lc1, tf->ns_uris, lc2, tf->ns_names)
{
Node *expr = (Node *) lfirst(lc1);
char *name = strVal(lfirst(lc2));
String *ns_node = lfirst_node(String, lc2);
if (!first)
appendStringInfoString(buf, ", ");
else
first = false;
if (name != NULL)
if (ns_node != NULL)
{
get_rule_expr(expr, context, showimplicit);
appendStringInfo(buf, " AS %s", name);
appendStringInfo(buf, " AS %s",
quote_identifier(strVal(ns_node)));
}
else
{