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 1jxhg2-0003zD-Bg for pgsql-hackers@arkaria.postgresql.org; Tue, 21 Jul 2020 02:06:42 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jxhg0-00035C-G9 for pgsql-hackers@arkaria.postgresql.org; Tue, 21 Jul 2020 02:06:40 +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 1jxhg0-000355-9D for pgsql-hackers@lists.postgresql.org; Tue, 21 Jul 2020 02:06:40 +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 1jxhfv-0001ih-AH for pgsql-hackers@lists.postgresql.org; Tue, 21 Jul 2020 02:06:39 +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 06L26Wjk794666; Mon, 20 Jul 2020 22:06:32 -0400 From: Tom Lane To: Dean Rasheed cc: PostgreSQL Hackers Subject: Re: Wrong results from in_range() tests with infinite offset In-reply-to: <4166230.1595107732@sss.pgh.pa.us> References: <3393130.1594925893@sss.pgh.pa.us> <3464257.1594936216@sss.pgh.pa.us> <3506768.1594947597@sss.pgh.pa.us> <3941233.1595081173@sss.pgh.pa.us> <4166230.1595107732@sss.pgh.pa.us> Comments: In-reply-to Tom Lane message dated "Sat, 18 Jul 2020 17:28:52 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <794664.1595297192.1@sss.pgh.pa.us> Date: Mon, 20 Jul 2020 22:06:32 -0400 Message-ID: <794665.1595297192@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk I wrote: > The other three cases where we'd hit NaNs are likewise symmetric with > non-NaN cases that'd return TRUE. Hence, I'm forced to the conclusion > that you've got it right above. I might write the code a little > differently, but const-TRUE-for-NaN-cases seems like the right behavior. > So I withdraw my objection to defining it this way. Unless somebody > else weighs in, I'll commit it like that in a day or two. Pushed, but I chickened out of back-patching. The improvement in what happens for finite comparison values seems somewhat counterbalanced by the possibility that someone might not like the definition we arrived at for infinities. So, it's not quite an open-and-shut bug fix, so I just put it in HEAD (for now anyway). regards, tom lane