Re: WIP - xmlvalidate implementation from TODO list - Mailing list pgsql-hackers

From Pavel Stehule
Subject Re: WIP - xmlvalidate implementation from TODO list
Date
Msg-id CAFj8pRBq4580f5n7DTe7x+SWqCS_d=e1Of7snUNaKk8_L1g28Q@mail.gmail.com
Whole thread Raw
In response to Re: WIP - xmlvalidate implementation from TODO list  (Jim Jones <jim.jones@uni-muenster.de>)
Responses Re: WIP - xmlvalidate implementation from TODO list
List pgsql-hackers


st 1. 4. 2026 v 9:47 odesílatel Jim Jones <jim.jones@uni-muenster.de> napsal:


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

pgsql-hackers by date:

Previous
From: Chao Li
Date:
Subject: Re: ALTER TABLE: warn when actions do not recurse to partitions
Next
From: Nisha Moond
Date:
Subject: Re: pg_createsubscriber: Fix incorrect handling of cleanup flags