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 1vcKgy-004slQ-31 for pgsql-hackers@arkaria.postgresql.org; Sun, 04 Jan 2026 09:46:34 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vcKgw-00EzO8-1S for pgsql-hackers@arkaria.postgresql.org; Sun, 04 Jan 2026 09:46:31 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vcKgv-00EzO0-2y for pgsql-hackers@lists.postgresql.org; Sun, 04 Jan 2026 09:46:30 +0000 Received: from forwardcorp1d.mail.yandex.net ([2a02:6b8:c41:1300:1:45:d181:df01]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vcKgt-00473c-1u for pgsql-hackers@lists.postgresql.org; Sun, 04 Jan 2026 09:46:29 +0000 Received: from mail-nwsmtp-smtp-corp-main-66.iva.yp-c.yandex.net (mail-nwsmtp-smtp-corp-main-66.iva.yp-c.yandex.net [IPv6:2a02:6b8:c0c:b812:0:640:c63e:0]) by forwardcorp1d.mail.yandex.net (Yandex) with ESMTPS id 05A59807CF; Sun, 04 Jan 2026 12:46:19 +0300 (MSK) Received: from smtpclient.apple (unknown [2a02:6bf:8080:982::1:23]) by mail-nwsmtp-smtp-corp-main-66.iva.yp-c.yandex.net (smtpcorp/Yandex) with ESMTPSA id Hkja2S0AseA0-7iCX8v34; Sun, 04 Jan 2026 12:46:18 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex-team.ru; s=default; t=1767519978; bh=H386WHToEF8IuCva/OTucKOl6nKpEpOYXfpr9tDI16g=; h=Message-Id:To:Date:References:Cc:In-Reply-To:From:Subject; b=r6VIgIxKqh27Zb92hqyxlYTsmfI5OwMjGMF61FPuBSkX1XrtvUmjBoce/iJi+rOt/ 8jIgDZ8Z8V1+3THcFSxPAXuMVUd/RdnxBfhjbccaCtrtAGWiZjZuGAuQRH9gCL2Tp2 f4VjQM3HOiggHYWMzDUCqNpKdsUlvX9a98UNU4uo= Authentication-Results: mail-nwsmtp-smtp-corp-main-66.iva.yp-c.yandex.net; dkim=pass header.i=@yandex-team.ru Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3826.700.81\)) Subject: Re: WIP - xmlvalidate implementation from TODO list From: Andrey Borodin In-Reply-To: <89DE974B-F318-4D0A-A60B-51EDE84054E2@gmail.com> Date: Sun, 4 Jan 2026 14:46:06 +0500 Cc: Kirill Reshke , PostgreSQL Hackers Content-Transfer-Encoding: quoted-printable Message-Id: <9A074422-2308-4BD0-9FFA-0B6D70989935@yandex-team.ru> References: <89DE974B-F318-4D0A-A60B-51EDE84054E2@gmail.com> To: Marcos Magueta X-Mailer: Apple Mail (2.3826.700.81) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk > On 2 Jan 2026, at 23:07, Marcos Magueta = wrote: >=20 > About the patch, let me know if you find the time to review! I was looking to review something on commitfest and decided to look into = this patch. Unfortunately, I cannot verify adherence to SQL standard. But I'll take = it as granted, grammar changes are minimal. I'm not a big XML user, but definitely there are a lot of use cases. = E.g. If someone want to check whole database against new schema - this = feature would be invaluable. I can think of many different use cases. = But I heard some complaints about libxml. I'm not sure, but maybe at = some point we would like to get rid of it? [0] The patch fails regression tests on Windows. See [1]. Regression taken = from [2] Meaningfull part is: diff --strip-trailing-cr -U3 = C:/cirrus/src/test/regress/expected/xml_1.out = C:/cirrus/build/testrun/regress/regress/results/xml.out --- C:/cirrus/src/test/regress/expected/xml_1.out 2026-01-03 = 19:13:07.092850000 +0000 +++ C:/cirrus/build/testrun/regress/regress/results/xml.out 2026-01-03 = 19:17:23.497562500 +0000 @@ -1496,3 +1496,278 @@ LINE 1: SELECT xmltext('x'|| '

73

'::xml || .42 || true || 'j':... ^ DETAIL: This functionality requires the server to be built with libxml = support. +SELECT xmlvalidate(DOCUMENT = 'John30' + ACCORDING TO XMLSCHEMA ' .... So you need to update src/test/regress/expected/xml_1.out for systems = without libxml. You use PG_TRY(); and return from that block. I found no other cases of = returning without PG_END_TRY(), looks like it is not supported. xmloption is document_or_content. But xmlvalidate_text_schema() always = validates as a document. IDK, maybe it's correct, or maybe it works by = accident. +#else + NO_XML_SUPPORT(); + return NULL; +#endif This NULL is returned from bool function xmlvalidate_text_schema(). I = know it's unreachable, but let's return false or true. Also, single-line comments worth converting to our usual C comments. The = patch could benefit from pgindent. That's all what I could find for now. Thanks for working on this! Best regards, Andrey Borodin. [0] = https://www.postgresql.org/message-id/flat/aUK8aBluNzMZTatU%40momjian.us [1] = https://api.cirrus-ci.com/v1/artifact/task/5580601438240768/testrun/build/= testrun/regress/regress/regression.diffs [2] https://cirrus-ci.com/task/5580601438240768=