Re: SELECT '(1, nan, 3)'::cube; - Mailing list pgsql-bugs

From Tom Lane
Subject Re: SELECT '(1, nan, 3)'::cube;
Date
Msg-id 2336.1300214620@sss.pgh.pa.us
Whole thread Raw
In response to Re: SELECT '(1, nan, 3)'::cube;  ("Robert Brewer" <fumanchu@aminus.org>)
List pgsql-bugs
"Robert Brewer" <fumanchu@aminus.org> writes:
> Tom Lane wrote:
>> I'd suggest rethinking your design to avoid needing NaN in a cube.

> I could, of course, use a sentinel value like -1 or even -Inf to mean
> "indeterminate", but I'd like future versions of this app (wink) to be
> able to use qnan's as IEEE 754 intended. Note that cube doesn't take
> NULL either. It may be surprising and underspecified, but using NaN and
> Inf in other cube operations (including gist indices) does indeed work
> quite well--probably because they are, after all, just floats. I believe
> it's a bug to handle only some subset of values of an extremely
> well-known and well-specified datatype like float, but of course I
> understand if contrib modules aren't high priority.

Well, this is the sort of thing that'll only get fixed when someone who
actually uses the datatype is motivated to improve it.  IOW, if you
submitted a patch it'd likely get accepted.

            regards, tom lane

pgsql-bugs by date:

Previous
From: "Robert Brewer"
Date:
Subject: Re: SELECT '(1, nan, 3)'::cube;
Next
From: Robert Brewer
Date:
Subject: SELECT '(1, nan, 3)'::cube