pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andreas Seltenreich <seltenreich@gmx.de>
Cc: Emre Hasegeli <emre@hasegeli.com>
Cc: pgsql-hackers@postgresql.org
Subject: Re: GiST index build versus NaN coordinates
Date: Tue, 12 Jul 2016 16:20:22 -0400
Message-ID: <3740.1468354822@sss.pgh.pa.us> (raw)
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>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>

I wrote:
> Andreas Seltenreich <seltenreich@gmx.de> 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



view thread (9+ messages)  latest in thread

Message-ID: <3740.1468354822@sss.pgh.pa.us>
Permalink:  ../3740.1468354822@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/3740.1468354822@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-hackers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, seltenreich@gmx.de, emre@hasegeli.com
  Subject: Re: GiST index build versus NaN coordinates
  In-Reply-To: <3740.1468354822@sss.pgh.pa.us>
  References: <28685.1468246504@sss.pgh.pa.us> <878tx7491q.fsf@credativ.de> <26005.1468341634@sss.pgh.pa.us> <3740.1468354822@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox