Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1w7Wno-005PVi-0S for pgsql-hackers@arkaria.postgresql.org; Tue, 31 Mar 2026 10:58:32 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w7Wnm-009jHq-2J for pgsql-hackers@arkaria.postgresql.org; Tue, 31 Mar 2026 10:58:31 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1w7Wnm-009jHi-1K for pgsql-hackers@lists.postgresql.org; Tue, 31 Mar 2026 10:58:30 +0000 Received: from mail-yx1-xb12b.google.com ([2607:f8b0:4864:20::b12b]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1w7Wnj-00000002A0J-42x7 for pgsql-hackers@lists.postgresql.org; Tue, 31 Mar 2026 10:58:30 +0000 Received: by mail-yx1-xb12b.google.com with SMTP id 956f58d0204a3-6501547d7edso5384836d50.0 for ; Tue, 31 Mar 2026 03:58:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1774954707; cv=none; d=google.com; s=arc-20240605; b=WJmyhr20D9zdcdRXFCjIocXu9ETH9L25HK2QxJvU8fNVXkbfZRnPQ3z9fK1aZ5zX8b mzK40gdPr1Rum9E2k4lWiFfbbjpKiyTiSVbMxlm+UTtPC/1nWmIYHiFl0g40oLZNq92c 4AFZOfs5Zg1l0Nj8Romjr0zjt3jHvUONyXRFVNQj+1fYDOJ0QAA2CWZ6IPh1G8IKD4K0 /VdNfoxwGxiVw2DRMageaJLhHl96cYPu/fb2c7884gkTthhSxKzyCLNDv00s6KLbqdFI GnwIu6Iq0zI2hnRSbFuELpc/ZiU5sITFFgUagsiqwquLO7/I8WC8/W0AGR8i2tS3Im/3 910Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:dkim-signature; bh=YksHZoIZ3q98aC4VLtjAwEDZmMrjCM6A87RrdK/uHH8=; fh=5C38rXdrwHN7kzHMO/WOCswz9K7vpN4bX6pJDueTjCc=; b=ig0PVKPlPEwuObn141Y/Nu3VoPx8yIl7HknAKiySY3uYf2g+FbLmw1LW1FsFh089bY 6Q8gugeRyyMksiLyxR25OYkHA/A2tLoMHcubqXSfjsQ90yDG9lBT+OEIHk/fZSVqrhfU YLqCQ9FSnw6wQnoRy6VOGTpwgu+g0BAGdLFEQB9Heqlyf9uphtoZqlgNQivH2th6CPyY CoyfRtVBeHWa8EhMWv0nLDllVx0i2NFR0Py5z84FhEdZss9kogBZ2A2BuOLkqeOpVdI3 xR/GxvgD3YGUyM6JNZKmemM3sKrGVTnj3gGPPjkLwjrb4FKzZ1VJmfjDgzJCLTcTbmZ+ wTag==; darn=lists.postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1774954707; x=1775559507; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=YksHZoIZ3q98aC4VLtjAwEDZmMrjCM6A87RrdK/uHH8=; b=on/aJoJRQxnr9m5rbd/uQuZbfIZkzhhlXKuosFiMQof+Rt69b13YYkJwNFLTcuVoPy OXnDbYUUSKlCrS5qx4UWHg4ugaaoM9movVvRSWJQAEmdaOPpDvAcBW8wIzYDoqDMGwgE DbrIZj00C4JNuJQ7H8xQjWs8KKEr4T5TFrL76GGVa3hAbzqlnt/+V3QxcZ6ovxmdqSWS RJNfe3YCRrp1HDAPRCZnMuAldF/Vr0tBS0J33J6gkqe2ZdA8MSouGC36/0YcanqJfTSD URk1HAEpRkxs2j+ZGFrOjVxyj6Q25fsf7GCv6d/edn9L81rUNozJSx4/AJkPkhh+kqbS jRNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774954707; x=1775559507; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=YksHZoIZ3q98aC4VLtjAwEDZmMrjCM6A87RrdK/uHH8=; b=GPK7qdJnJu/hj40zmOx6An+VDbGTVWW4wQnW6INNekRB3ewhYhLwqlI2akOOR4J+ly wH/rTNrm0pYebbBem+3Aj7CRiRdRbkd86dLEyBlWUMkOb9sKOHjcHrbyUhwInoJ9iVu6 wo7rMyzCBy7P9YIGghsB3H86N4I5bbTYUXT2UWcLKRgPls3UWanbIRBRJ2js/z1NeGUv ei0bAQ7xXT4W814tQD2MqW2hVkgTEiHTji724R7jl7+dxV0P2AfABn3mO8vMDMe7gbbG kQgRg8AOkHQvfs1k8lOc5tQaMA1MSMMOWJYvkBaGdmLG63IXk40/H3sc9BAJe4F5ucnf 3cCw== X-Forwarded-Encrypted: i=1; AJvYcCXQR/wJsXzLrVqveVohWjo0K+HaYPB8/hugkOx1v9Akv+lTqdBapmgV0XqtvPmM2BhzXepwWF4y1Ft+fFRE@lists.postgresql.org X-Gm-Message-State: AOJu0YzNgroGHTQM7I9hApptE4iSzUzkUH9UJJWMpho7QbfIjjMv0PTj Wtq0LKmfXI1ttG0GcmEwo4vZQ8KKD0yzRChSX8Xfytzqsc/PGJS380h4xFjE4LmtlZIJTO1SQAz 0VekeftcO1Yfjn3AnerfEq6HoanDGWwQ= X-Gm-Gg: ATEYQzwMpcQeQxh3nsXmsQrV2AAF2+l/iThkUWKokFliMlA7fo4rZgnEvTMZ8sVGXfq +2tDMJ9/U4w2UR/s2kRxOkitFmkqrITGt1OO03pkPDVqzKIDG0W4s/cIs+VaRqprkzPi1VF3bcQ c/GEwdu3C7MVrM3O4AeYy6uNY0PSQGJYxEpkfj4ovWKA4yLP6EZ0mhCZDdRY4S2siDZFrlTN5nm C7Zhr3y0hlEfCNGkKOEmQzqQ98R+IQPvyxzLYyM8E9lcoCO1eXxc96FI3IStsq6WktKBVGkabcZ Q5/zAYXKSE6YuidVOJky2LnrJDMMPMzdoBtzsHMEcA3E5qj5uEj2pNSCNYKFbaEBIxvK2Xx4ZDr XZ0eXxiAGyLfdadrBgW0AluqbRICGR8EUM9C56XR7NukWWpCRF/ZKcBpxMQ== X-Received: by 2002:a05:690e:144c:b0:650:d66:9265 with SMTP id 956f58d0204a3-6500d66982dmr10667177d50.57.1774954706890; Tue, 31 Mar 2026 03:58:26 -0700 (PDT) MIME-Version: 1.0 References: <08052569-9384-41b5-bcb7-33929fcc6c71@uni-muenster.de> <2ba05acc-6392-42a4-b59e-61df086b2d4d@uni-muenster.de> <1d49e214-93bc-4928-945c-27e60251a6ad@uni-muenster.de> <9228b6dc-cfae-4a11-927a-209680f5507e@uni-muenster.de> <2f8ca841-0956-4e7d-8fa2-038b879c8f4d@uni-muenster.de> In-Reply-To: From: Pavel Stehule Date: Tue, 31 Mar 2026 12:57:49 +0200 X-Gm-Features: AQROBzB8WJx7-6sgTipR4MYU7MlbN4x6hfaBiERsW4qb4-Irr5v-dIDqjTlFBbU Message-ID: Subject: Re: WIP - xmlvalidate implementation from TODO list To: Jim Jones Cc: Marcos Magueta , Andrey Borodin , Kirill Reshke , PostgreSQL Hackers Content-Type: multipart/alternative; boundary="000000000000cbf23b064e4fd826" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000cbf23b064e4fd826 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable =C3=BAt 31. 3. 2026 v 11:29 odes=C3=ADlatel Jim Jones napsal: > > > 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. > I found https://www.developpez.net/forums/d540201/bases-donnees/db2/validation-xml-= db2-v9-5-a/ > > 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 > > =3D=3D event triggers (event_trigger.c) =3D=3D > > 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. > > =3D=3D corrupt dump =3D=3D > > 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. > > =3D=3D inconsistent DDL statements =3D=3D > > 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. > > =3D=3D different error message for build without libxml =3D=3D > > 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 > > > > --000000000000cbf23b064e4fd826 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=C3=BAt 31. 3. = 2026 v=C2=A011:29 odes=C3=ADlatel Jim Jones <jim.jones@uni-muenster.de> napsal:


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 usin= g
> 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.
I found https://www.developpez.net/forums/d5= 40201/bases-donnees/db2/validation-xml-db2-v9-5-a/


> 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 cas= e
> using ACL can be messy, and I can imagine having some dedicated role > that can register=C2=A0a 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 - ther= e
> ACL should be used.


A few other things I noticed in v6

=3D=3D event triggers (event_trigger.c) =3D=3D

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.

=3D=3D corrupt dump =3D=3D

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.

=3D=3D inconsistent DDL statements =3D=3D

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

=3D=3D different error message for build without libxml =3D=3D

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

Thanks!

Best, Jim



--000000000000cbf23b064e4fd826--