public inbox for [email protected]  
help / color / mirror / Atom feed
From: Jim Jones <[email protected]>
To: Pavel Stehule <[email protected]>
Cc: Marcos Magueta <[email protected]>
Cc: Andrey Borodin <[email protected]>
Cc: Kirill Reshke <[email protected]>
Cc: PostgreSQL Hackers <[email protected]>
Subject: Re: WIP - xmlvalidate implementation from TODO list
Date: Tue, 31 Mar 2026 11:29:38 +0200
Message-ID: <[email protected]> (raw)
In-Reply-To: <CAFj8pRB3d_fREmgzT1GQwG_wfR1brxyTMVsAV=bbpOzvPkauLg@mail.gmail.com>
References: <CAN3aFCdx8AapWSVpJ1kaC7OC_v7QwbjgbGw9WfPBBY2GMyOadQ@mail.gmail.com>
	<CAN3aFCcUFLbdVBoL6c2bMh4r5P9EnXM9eBsX8+ZyER7YBSDUtA@mail.gmail.com>
	<[email protected]>
	<[email protected]>
	<[email protected]>
	<CAN3aFCecpcPBs4x3KUuxTqvY2VzpCZZKrBphNaQjE5uD8UtEpQ@mail.gmail.com>
	<CAN3aFCcb0Nvap1CKShd5RNa+V+pray+ur_LtOON3nkwqdh5NMA@mail.gmail.com>
	<[email protected]>
	<CAN3aFCdW3_RNgidcV_vWA-NFeYf6p7M5VMG8moSzk3bBJneUxQ@mail.gmail.com>
	<[email protected]>
	<CAN3aFCfkrkOJ+R39x=9qvXMGLE3yuL9fZdNyRa5V=BAdGGu=-g@mail.gmail.com>
	<[email protected]>
	<CAN3aFCcvXHmW+FKS7gX=HoUcjku2nr7XKJEZm05DrgsQxy79HQ@mail.gmail.com>
	<[email protected]>
	<CAFj8pRB3d_fREmgzT1GQwG_wfR1brxyTMVsAV=bbpOzvPkauLg@mail.gmail.com>



On 30/03/2026 22:28, Pavel Stehule wrote:
> I checked db2 doc, and if I understand their doc, the XML schema is
> identified by "relational identifier" SQLschema.name
> 
> So taking XML schema as catalog object is the correct analogy and using
> acl looks to me correct.

+1

> But what is different (patch and db2), one relational identifier can
> identify a group of XML schemas. So there is relation 1:N not 1:1. You
> can see the REGISTER XMLSCHEMA command.

I wonder what are the applications for this 1:N relationship between xml
schemas and their identifiers. Sounds cool though.

> The schema registration is different on MSSQL where it is more similar
> to some local cache, and schema is identified only by uri. In this case
> using ACL can be messy, and I can imagine having some dedicated role
> that can registerĀ a new xml schema. But MSSQL doesn't support SQL/XML
> XMLVALIDATE function.
> 
> Both concepts are workable, and I have no strong preference for one or
> second (maybe DB2 concept is better for Postgres, probably DB2 concept
> is closer to SQL/XML). But if we use relational identifiers, then it
> should be consistent with other usage of relational identifiers - there
> ACL should be used.


A few other things I noticed in v6

== event triggers (event_trigger.c) ==

OBJECT_XMLSCHEMA is in the elog(ERROR) path of stringify_grant_objtype()
and stringify_adefprivs_objtype(). Since the grammar does support
GRANT/REVOKE ... ON XMLSCHEMA, any event trigger on ddl_command_end that
fires during a GRANT on an XML schema will raise a elog(ERROR,
"unsupported object type").

An additional test here would be nice as well.

== corrupt dump ==

pg_dump is ignoring GRANT statements. Since the feature supports
GRANT/REVOKE on XMLSCHEMAS, omitting ACL dump means privileges are
silently lost during dump/restore.

== inconsistent DDL statements ==

The docs suggest that ALTER XMLSCHEMA ... IF EXISTS is supported, which
isn't the case. It should be either implemented or just removed from the
docs.

== different error message for build without libxml ==

In xml.c the error messag used is "unsupported XML feature", but you're
using "xmlschema support requires libxml" in pg_xmlschema.c. I think we
should be consistent here.

Thanks!

Best, Jim








view thread (17+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]
  Subject: Re: WIP - xmlvalidate implementation from TODO list
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox