| From: | Joao Rito <joaovictor(dot)rito(at)gmail(dot)com> |
|---|---|
| To: | Jim Jones <jim(dot)jones(at)uni-muenster(dot)de> |
| Cc: | PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org> |
| Subject: | Re: XMLTable treats a column of a domain over xml as a non-xml column |
| Date: | 2026-11-19 00:18:17 |
| Message-ID: | 20261119001817.4330-1-joaovictor.rito@gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
Hi,
Thank you for the patch, Jim.
I tested v1-0001 on current master (8303f2e), built with
--with-libxml and --enable-cassert. The patch applied cleanly.
Without the patch, I could reproduce the problem. With your example,
column c2 (domain over xml) returns "x", while the xml column c1
returns "<a>x</a>". With the patch, both columns return "<a>x</a>".
The SQL from your new regression test fails on master with "more than
one value returned by column XPath expression" and works with the patch.
I also tried a few variations. With the patch:
* A domain over another domain over xml behaves like xml.
* A domain over xml with CHECK (value IS DOCUMENT) returns the
document for path '.', and raises the check constraint error when
the path returns two elements.
* An empty element <a/> and a comment() result in a domain column
look the same as in an xml column.
* Columns of type text, varchar, and domains over text and int gave
the same result as without the patch.
* A "default" clause and a no-match path gave the same result as
without the patch.
* FOR ORDINALITY together with a domain column works.
I read the change in XmlTableGetValue(). It looks small and clear to
me. The domain's own input function is still used, so the domain
constraints still run.
What I did not test:
* make check or make check-world, and the TAP tests.
* The xml regression test itself against an unpatched tree.
* Other platforms, or builds without libxml.
* Domain over xml with a typmod, or domain over an array of xml.
* Whether other places in xml.c need the same getBaseType() change.
Thank you again for working on this.
Best regards,
Joao Rito
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Chao Li | 2026-11-19 00:24:15 | Re: Fix ISSN output truncation when the issue code is nonzero |
| Previous Message | Peter Smith | 2026-11-19 00:07:44 | Re: [PATCH v1] Fix initial sync of zero-column published tables |