Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id D1C161337BCC for ; Tue, 15 Mar 2011 15:43:50 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 81555-05 for ; Tue, 15 Mar 2011 18:43:43 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by mail.postgresql.org (Postfix) with ESMTP id 234591337BC4 for ; Tue, 15 Mar 2011 15:43:42 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id p2FIhf6V002337; Tue, 15 Mar 2011 14:43:41 -0400 (EDT) To: "Robert Brewer" cc: pgsql-bugs@postgresql.org Subject: Re: SELECT '(1, nan, 3)'::cube; In-reply-to: References: <432.1300208836@sss.pgh.pa.us> Comments: In-reply-to "Robert Brewer" message dated "Tue, 15 Mar 2011 10:54:22 -0700" Date: Tue, 15 Mar 2011 14:43:40 -0400 Message-ID: <2336.1300214620@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-5 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201103/225 X-Sequence-Number: 29735 "Robert Brewer" 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