Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jlx4w-0004ab-1N for pgsql-hackers@arkaria.postgresql.org; Thu, 18 Jun 2020 16:07:50 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jlx4u-0000Mr-RO for pgsql-hackers@arkaria.postgresql.org; Thu, 18 Jun 2020 16:07:48 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jlx4u-0000Mk-Kk for pgsql-hackers@lists.postgresql.org; Thu, 18 Jun 2020 16:07:48 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jlx4s-0000h8-Fe for pgsql-hackers@lists.postgresql.org; Thu, 18 Jun 2020 16:07:48 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 05IG7ipr1552002; Thu, 18 Jun 2020 12:07:44 -0400 From: Tom Lane To: Oleg Bartunov cc: Alexander Korotkov , PostgreSQL Hackers Subject: Re: jsonpath versus NaN In-reply-to: References: <203949.1591879542@sss.pgh.pa.us> <355114.1591902003@sss.pgh.pa.us> <1446772.1592407984@sss.pgh.pa.us> Comments: In-reply-to Oleg Bartunov message dated "Thu, 18 Jun 2020 18:51:04 +0300" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1552000.1592496464.1@sss.pgh.pa.us> Date: Thu, 18 Jun 2020 12:07:44 -0400 Message-ID: <1552001.1592496464@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Oleg Bartunov writes: > The problem is that we tried to find a trade-off between standard and > postgres implementation, for example, in postgres CAST allows NaN and > Inf, and SQL Standard requires .double should works as CAST. As I said, I think this is a fundamental misreading of the standard. The way I read it is that it requires the set of values that are legal according to the standard to be processed the same way as CAST would. While we certainly *could* choose to extend jsonpath, and/or jsonb itself, to allow NaN/Inf, I do not think that it's sane to argue that the standard requires us to do that; the wording in the opposite direction is pretty clear. Also, I do not find it convincing to extend jsonpath that way when we haven't extended jsonb. Quite aside from the ensuing code warts, what in the world is the use-case? regards, tom lane