Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bN4Bp-0008LF-AT for pgsql-hackers@arkaria.postgresql.org; Tue, 12 Jul 2016 20:21:57 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1bN4Bo-0002UL-Te for pgsql-hackers@arkaria.postgresql.org; Tue, 12 Jul 2016 20:21:56 +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.84_2) (envelope-from ) id 1bN4AS-0000xn-Bq for pgsql-hackers@postgresql.org; Tue, 12 Jul 2016 20:20:32 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bN4AP-0002Mv-6N for pgsql-hackers@postgresql.org; Tue, 12 Jul 2016 20:20:31 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id u6CKKMCm003741; Tue, 12 Jul 2016 16:20:22 -0400 From: Tom Lane To: Andreas Seltenreich cc: Emre Hasegeli , pgsql-hackers@postgresql.org Subject: Re: GiST index build versus NaN coordinates In-reply-to: <26005.1468341634@sss.pgh.pa.us> References: <28685.1468246504@sss.pgh.pa.us> <878tx7491q.fsf@credativ.de> <26005.1468341634@sss.pgh.pa.us> Comments: In-reply-to Tom Lane message dated "Tue, 12 Jul 2016 12:40:34 -0400" Date: Tue, 12 Jul 2016 16:20:22 -0400 Message-ID: <3740.1468354822@sss.pgh.pa.us> X-Pg-Spam-Score: -3.2 (---) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org I wrote: > Andreas Seltenreich writes: >> The infinite loop from the bug report was triggered. Further, two >> previously unseen errors are logged: >> ERROR: timestamp cannot be NaN >> ERROR: getQuadrant: impossible case >> The first is porbably as boring as it gets, the second one is from the >> getQuadrant() in spgquadtreeproc.c. > Yeah, the first one is presumably from float8_timestamptz() intentionally > rejecting a NaN, which seems fine. >> Curiously, the getQuadrant()s in geo_spgist.c and rangetypes_spgist.c do >> not have such a check. I guess the boxes will just end up in an >> undefined position in the index for these. > Right, we probably want them all to apply some consistent ordering --- > doesn't matter so much what it is, but float8's rule is as good as any. I looked into these a bit more closely. I think rangetypes_spgist.c is fine as-is: it's relying on the range component type to provide a total ordering of its values, and if the component type fails to do that, it's the fault of the component type not the range code. spgquadtreeproc.c and geo_spgist.c both have got NaN issues, but the code in both of them is rather tightly tied to the fuzzy-geometric-comparisons logic that Emre has been messing with. I think we ought to put "what to do with NaNs?" into that same can of worms, rather than try to resolve it separately. (Yeah, I know, I just made Emre's job even harder.) regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers