On 31/03/2026 12:57, Pavel Stehule wrote:
> I found https://www.developpez.net/forums/d540201/bases-donnees/db2/
> validation-xml-db2-v9-5-a/ <https://www.developpez.net/forums/d540201/
> bases-donnees/db2/validation-xml-db2-v9-5-a/>
Interesting. In DB2 it looks indeed more like a schema composition.
Perhaps something to consider once the current approach is ready.
It should be considered from the beginning - it means that the relational identifier is not unique. It can complicate upgrades. And it can complicate possible ports from db2.
maybe it can be implemented just as an extension - we don't need DDL commands CREATE XMLSCHEMA - there can be some function. If I understand correctly, the SQL/XML knows just XMLVALIDATE command - and in the first step - this can be just a function too.
Theoretically there can be different access - we can introduce a generic XMLVALIDATE command, that can call some callback. This callback can be implemented in an extension. One extension can XML storage identified by relation identifier, another can implement some shared storage on the disc outside the database etc. So the organization of the patch can be different
1. creating API for extensions for implementing loading the schema from some sources.
2. implementation XMLVALIDATE that uses this API
3. creating an extension in contrib, that implements XML storage identified by relational API.
Because we don't have an extensible parser, the XMLVALIDATE command should be in core, but other parts are not.
XML is a little bit outdated - but the proposed infrastructure can be used for any documents, so it can theoretically supports json, jsonb too, and this can helps with accepting XMLVALIDATE to core. I expect something like XMLVALIDATE will be JSON standard in a few years.
Regards
Pavel
Best, Jim