Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1gFoId-0007U6-Dj for pgsql-hackers@arkaria.postgresql.org; Thu, 25 Oct 2018 22:40:19 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gFoIa-0000RV-RV for pgsql-hackers@arkaria.postgresql.org; Thu, 25 Oct 2018 22:40:16 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1gFoIa-0000RO-9K for pgsql-hackers@lists.postgresql.org; Thu, 25 Oct 2018 22:40:16 +0000 Received: from bay.acenet.us ([173.230.252.50]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1gFoIS-0001qw-RC for pgsql-hackers@postgresql.org; Thu, 25 Oct 2018 22:40:15 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=anastigmatix.net; s=default; h=Content-Transfer-Encoding:Content-Type: In-Reply-To:MIME-Version:Date:Message-ID:From:Cc:References:To:Subject:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=a6dRmVNqhXdBT8/oRN4hirBIAxsb/agqIe5WlVNyoko=; b=XZUYk1fyPU6/xDKDZu1rZxPDEH rkQXCJfS8cUGyyB5L/gaDxyAAf2e6z73YHPOKVfyB9XyDcwWpYH7U05KFWluUZ5FP7v8AWfh4s47r hPIaDArqfMj0kRu6jAmp6Px/x5exDjU7BYX3VOJ3PojiXNLj+PyoDS+Lj0KeLuzGLYMT20EuwBXAu C1i/YMkdhXM0+TWvrVL0TnBqdO2DTv/bHaAcS97RCDpvEow/lCQS3mJsOE1ZJ6/HiXwSXW5fak0Md noze1R6SOsDC5XOyTTctutV0fTv9HxKgi9PZtJNOIzmBcH+xMHuTMWtF2Ka55OftQ0KiPI4D3Gss4 MReBJXjw==; Received: from [184.19.49.99] (port=36785) by bay.acenet.us with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.91) (envelope-from ) id 1gFoIL-00GWgN-BR; Thu, 25 Oct 2018 18:40:06 -0400 Subject: Re: PostgreSQL vs SQL/XML Standards To: Pavel Stehule , Alvaro Herrera References: <2a7715e1-6170-c3f6-12c7-7e5dda84cecd@anastigmatix.net> <20181025150849.j4py2nkqjx3cgw26@alvherre.pgsql> Cc: Tom Lane , PostgreSQL Hackers From: Chapman Flack X-Enigmail-Draft-Status: N1110 Message-ID: <5BD24640.50105@anastigmatix.net> Date: Thu, 25 Oct 2018 18:40:00 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-OutGoing-Spam-Status: No, score=-95.0 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - bay.acenet.us X-AntiAbuse: Original Domain - postgresql.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - anastigmatix.net X-Get-Message-Sender-Via: bay.acenet.us: authenticated_id: chap+anastigmatix.net/only user confirmed/virtual account not confirmed X-Authenticated-Sender: bay.acenet.us: chap@anastigmatix.net X-Source: X-Source-Args: X-Source-Dir: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 10/25/18 11:15, Pavel Stehule wrote: > čt 25. 10. 2018 v 17:09 odesílatel Alvaro Herrera > napsal: >> Maybe the best way forward is to implement all the JSON functionality >> and remove the SQL/XML bits. > > It can be bigger compatibility break in Postgres history. SQL/XML functions > are widely used. It seems to me that evolution to the 2006+ standard version could be done mostly non-disruptively (provided an agreeable library can be found). I think Tom's suggestion[1] to just make XML OPTION CONTENT mean what it means in 2006+ would be an easy change to make immediately, and would not disrupt anybody ... it would only make some things succeed that now fail, and it would match what our documentation already says. It would make our XML type equivalent to 2006+ XML(CONTENT(ANY)). Beyond that, further steps toward 2006+ could largely avoid disruption. If we implement the typmod'ed XML types, surely the parser would simply treat untypmod'ed 'XML' as meaning XML(CONTENT(ANY)). (The standard does allow for the typmod to be missing, and leaves it "implementation-defined whether SEQUENCE, CONTENT(ANY), or CONTENT(UNTYPED) is implicit", so that's all by the book.) The existing functions xpath and xpath_exists can be kept unchanged, as their names are distinct from anything in the standard. A library that supports XQuery is likely also to support XPath in "1.0 compatibility mode", so those functions could keep their semantics. The current xmlvalidate() has the wrong semantics and return type, but it also does nothing but ereport unimplemented, so no current uses would be hurt by redefining it. XMLTABLE would be the headache. Using the standard name for something that ain't the standard function has not left any painless way that the standard function could be added. OTOH, it has only been in the wild since 10, so renaming it to something else (xpath_table?) will probably be more painless if done soon than it ever would be later. On 10/25/18 11:23, Andreas Karlsson wrote: > The libraries we depend on should really either be available in the > package repositories of the major Linux distribution or be something > we can put in our own repository and maintain without too much pain. > So using Saxon/C does not seem like a realistic option. That makes good sense. The approach I proposed in [2] would be to target the XQC API as an integration point. If there is one library that might be most acceptable (it seems xqilla is in several repositories), it could become a preferred or supported choice, but others could be available if an administrator wanted to separately obtain them, perhaps because of better performance on a particular workload, or avoidance of some bug that a given workload turns up. -Chap [1]: https://www.postgresql.org/message-id/22271.1540458133%40sss.pgh.pa.us [2]: https://wiki.postgresql.org/wiki/PostgreSQL_vs_SQL/XML_Standards#One_proposal