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 1w7ytL-0005y8-1D for pgsql-hackers@arkaria.postgresql.org; Wed, 01 Apr 2026 16:58:07 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w7ytJ-001Sdj-33 for pgsql-hackers@arkaria.postgresql.org; Wed, 01 Apr 2026 16:58:06 +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 1w7ytJ-001Sda-22 for pgsql-hackers@lists.postgresql.org; Wed, 01 Apr 2026 16:58:06 +0000 Received: from mail-yx1-xb12f.google.com ([2607:f8b0:4864:20::b12f]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1w7ytH-000000002uk-1RkB for pgsql-hackers@lists.postgresql.org; Wed, 01 Apr 2026 16:58:05 +0000 Received: by mail-yx1-xb12f.google.com with SMTP id 956f58d0204a3-64d5a7926cfso10293329d50.2 for ; Wed, 01 Apr 2026 09:58:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1775062681; cv=none; d=google.com; s=arc-20240605; b=F9WQIDyE72ZuT8Cn/X+wanb8Aa0p8uf0WAqLF1K/3T0lSgNqTBF9DLPmOpebudpG60 qMWgzH1H9gJCIkrNC3Ldq+1UaZ+O9nLpiRrAq1azEGmCQjy8r0750EmjatYKDsVxpOWS h6ge04LHo5eNlie2yIJZ3Rrldq79WO2WtO74DCnoy7dB+e/oN+NZiTMVWpvUp1abx1F5 DS+nh16YyKw0ZX7jNQ+Yw1rtsiX2hgAhXlXztQxkr21y05wMR2BUGa8bKhrYGir9WdoO sVRWCBgW9HWYVO6DtKMn/fZ2AsJ7kQTbgRGxwV1OjR9TFAJnK3NAx86y6aCD1BvTdbuF 0VvQ== 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=dlltQr+Edxp33w1TIbOHt5gDmFtP8hbP3R6DAR0/Yy0=; fh=dlYeP0fYurLzjMuxGO9+ZgawIvXjDpc3H7eyLPT2l34=; b=fKpQWMoPH4WUr7Tk1ZtTL75GpIS7vMDK5zn4A3zsh/fgSJ+T+HwD4nmJbEYZzcyrSW 59VAw7c1RQH2ulUN7qIyUewCoyOjdyHaOG1Wb+9oedf5qofbNODrMaDMNUVDTa9LPWZH ete1Diq5WxKk2DW1yJouVN9VGR67IQE39vevnbWLR2rJpHW3FILMf7tHLRe+u6BZv+ZJ 2h0652MVy2+Hu1mW+4bYaX0xlTdJy/2VpqD8TYgiTvHeHAgvbvlYsz8zZ6wy54+s9DMM 9cAPUG4FHsnaQLVyyOm6Fz8gBxyhWQuVLrpOpyhvGWUr8ThHzf9gO6MhxCIOnOuGG/Bl ZWlg==; 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=1775062681; x=1775667481; 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=dlltQr+Edxp33w1TIbOHt5gDmFtP8hbP3R6DAR0/Yy0=; b=ArjYJe7QvVmVMfSACROLlN9M+DGr/8DHDnogb0DkzCXW3H7BC2a0WMSfwT0eJzw2PH OFk19AejjZJ5Aa93Gs0YQhQ9gumfJ+awavlz+btShnC+3ZQYBRCH9lZE6WP2toBfiUJK mukwQxU8EhRKOzFSfxkWdHFoqZxwW7Zt/MladcirZtXxGMlE9LvgLbwZ1Gbw3+rLDI5W ZESxH0/UTqDMgNTG64nQ07QxH2X5G8j37FzWMk18QpoJdTmwaJNooB2T+vKHg/IAFDbK n7zofVNgU/cnfn0PKKqG4eVrWAqGm8oVQeEBgO9gCbtDzIVUVDBqpdjsU9mC+5U89+rd PqrQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775062681; x=1775667481; 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=dlltQr+Edxp33w1TIbOHt5gDmFtP8hbP3R6DAR0/Yy0=; b=V9jaM5hAF3JVx+cA5+xnVjfg8QTL4Bwu2cHmF8271HT6ig2kGzqYZJCRohHhgSliew /6f+OqDFQqF77s8Gop6MsqXPJXXgCgtyv4RYM7MzWsRyHlmgg45UyVw7dhjVA0Ofpjv0 71gCqEWN98PpfcQOibpiBpAaSTKMXtbG+tpSBimY1fyMdJFfLbGwBBZ1rslhfSrRqTqk 2F7xvZqMBaq3cvyJCmAsDWfWChBJtPEMfn9rw8OJ6XfSJQl9b6pCXyELPVbR4uFdnKxD WXo4Qdv+5lcVb33BzrmLrtg5AItyM4tJ1SFKuUaWqQjmtl9L1eGL2BkKV/zIRWM5kFjP FG/A== X-Forwarded-Encrypted: i=1; AJvYcCUAfZX7j/pSCVN2YlzJqxqvkuERz62QstklvSSrhmgDYvr2x6hd1M6QbkiA0IogZj3dcpFR1Cp59we3drej@lists.postgresql.org X-Gm-Message-State: AOJu0Yx4U3R0Uf4RxEhOzkSXxEPmT6/IgIGfR9ZXefyZKyzOOzjB22It PMVPBQlO1sUNAZHIWKejf2YlALbp+wE0lh803bs/FMJna0/MZVFeiNsLUED02EX7DAMU6kgfSa0 QATQwqv+vP+2AdGXE5TOBAjeT5fE675s= X-Gm-Gg: ATEYQzxCswqPyiV7jDM/GmrTfyxptw+kf/oL4tPNpuYPm8kFMdskRtvAjFSI5U7L+pc F/1ZMFeLTwBXyFbZGsnDVTM6w1C4eoRNL6M1/Hu6W97PKoVNO9S0ZQWx+c1/a5+wA3o572PYvKS Lrmb2Sln72WrYU+pyj1P+z5fRy0dHdRJkgqxTE13wyKjF8Hlaro6/K3FyS4rp/LPgWTKYNfUNXa Qu23961cyFa3P9eOmpdM3faZcq4q8Cg8HdLvF0FRmTXmWH1MdRowG2ljU5cLF+G51gt06kvh2Ls rpO4+SlVsQaI5IuLldjo2Y8mAKFVw1mdzWsAZ19j5BE99dP5EpX4fJA4pLhxU2+Jev/xgihcUvt wjGLts1/yJLRAGhjLsSwO41AREpfZhNVUsPXrwUtkI3s4HGEkLSQlnU3jlA== X-Received: by 2002:a53:b174:0:b0:650:95e:2fc with SMTP id 956f58d0204a3-6502fe4c3demr3254333d50.40.1775062681420; Wed, 01 Apr 2026 09:58:01 -0700 (PDT) MIME-Version: 1.0 References: <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: Wed, 1 Apr 2026 18:57:24 +0200 X-Gm-Features: AQROBzDs-sNdhiKayhehEbqtyhk28fVFh0rF_Sj6eLCblHPkwywDYaF4Jr9SWp0 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="0000000000009486c6064e68fc51" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000009486c6064e68fc51 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable st 1. 4. 2026 v 16:39 odes=C3=ADlatel Jim Jones napsal: > > > On 01.04.26 10:10, Pavel Stehule wrote: > > 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 firs= t > > step - this can be just a function too. > > Yeah, the spec does not dictate how the schemas are stored or how > identifiers are mapped to XSDs. The way I see it, in the current state > of this patch, we miss the option to add XSDs to an existing XMLSCHEMA > identifier (something like ALTER XMLSCHEMA .. ADD ...), or even the > option to pass multiple XSDs in CREATE XMLSCHEMA. > > It makes the implementation of CREATE XMLSCHEMA (or similar DDL) a bit > more challenging, as it must always resolve all root's dependencies to > ensure that XMLVALIDATE has all the necessary info to validate a given XM= L. > > > > > Theoretically there can be different access - we can introduce a generi= c > > XMLVALIDATE command, that can call some callback. This callback can be > > implemented in an extension. One extension can XML storage identified b= y > > 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. > > > How would XMLVALIDATE without this contrib extension look like? > The API can be similar to PLpgSQL plugin API - and rendezvous variable Pavel > > Best, Jim > --0000000000009486c6064e68fc51 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


st 1. 4. 2026 v= =C2=A016:39 odes=C3=ADlatel Jim Jones <jim.jones@uni-muenster.de> napsal:


On 01.04.26 10:10, Pavel Stehule wrote:
> maybe it can be implemented just as an extension - we don't need D= DL
> commands CREATE XMLSCHEMA - there can be some function. If I understan= d
> correctly, the SQL/XML knows just XMLVALIDATE command - and in the fir= st
> step - this can be just a function too.=C2=A0

Yeah, the spec does not dictate how the schemas are stored or how
identifiers are mapped to XSDs. The way I see it, in the current state
of this patch, we miss the option to add XSDs to an existing XMLSCHEMA
identifier (something like ALTER XMLSCHEMA .. ADD ...), or even the
option to pass multiple XSDs in CREATE XMLSCHEMA.

It makes the implementation of CREATE XMLSCHEMA (or similar DDL) a bit
more challenging, as it must always resolve all root's dependencies to<= br> ensure that XMLVALIDATE has all the necessary info to validate a given XML.=

>
> Theoretically there can be different access - we can introduce a gener= ic
> 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<= br> > disc outside the database etc. So the organization of the patch can be=
> different=C2=A0
>
> 1. creating API for extensions for implementing loading the schema fro= m
> 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 comman= d
> should be in core, but other parts are not.


How would XMLVALIDATE without this contrib extension look like?

The API can be similar to PLpgSQL plugin API - and= rendezvous variable

Pavel=C2=A0=C2=A0

Best, Jim
--0000000000009486c6064e68fc51--