Re: [DEPARSE] A COLLATE clause in the URI of XMLNAMESPACES does not read back

From: Henson Choi <assam258(at)gmail(dot)com>
To: Prashant Chinnam <crprashant(at)hotmail(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [DEPARSE] A COLLATE clause in the URI of XMLNAMESPACES does not read back
Date: 2026-10-26 05:44:21
Message-ID: CAAAe_zB7vkvuHXbzqHAMzXA3fhxuDQXtZpgP=AOEnZpZTnYybA@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi Prashant,

> One small coverage note: the new test covers the pretty, named-AS
> form. The DEFAULT form and the non-pretty output are exercised by
> my testing above but are not in the patch's tests; a DEFAULT line
> in the new test would be a nice addition, but I do not consider it
> a blocker.

v2, attached, adds a DEFAULT namespace to the view in the test:

XMLNAMESPACES(('http://x.y' COLLATE "C") AS p,
DEFAULT ('http://x.z' COLLATE "C"))

so the expected output now shows both URIs printed bare before the
fix and in parentheses after it:

before:
XMLNAMESPACES ('http://x.y'::text COLLATE "C" AS p,
DEFAULT 'http://x.z'::text COLLATE "C")
after:
XMLNAMESPACES (('http://x.y'::text COLLATE "C") AS p,
DEFAULT ('http://x.z'::text COLLATE "C"))

The code in 0002 is unchanged from v1. The DEFAULT branch already
got the parentheses there; the test now checks it.

I did not add the non-pretty output. It reads back even before the
fix, so it would not catch this problem coming back.

Regards,
Henson

Attachment Content-Type Size
v2-0001-Add-a-test-for-a-COLLATE-clause-in-the-URI-of-XML.patch application/octet-stream 3.7 KB
v2-0002-Parenthesize-the-URI-of-XMLNAMESPACES-unless-it-i.patch application/octet-stream 4.4 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Nisha Moond 2026-10-26 06:29:19 Re: Proposal: Conflict log history table for Logical Replication
Previous Message Peter Smith 2026-10-26 05:42:38 Re: DOCS - CREATE PUBLICATION wording re 'ONLY' for partitioned tables.