Re: Re: [GENERAL] +/- Inf for float8's - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Re: [GENERAL] +/- Inf for float8's
Date
Msg-id 3777.966879572@sss.pgh.pa.us
Whole thread Raw
In response to Re: Re: [GENERAL] +/- Inf for float8's  ("Ross J. Reedstrom" <reedstrm@rice.edu>)
Responses Re: Re: [GENERAL] +/- Inf for float8's  ("Ross J. Reedstrom" <reedstrm@rice.edu>)
List pgsql-hackers
"Ross J. Reedstrom" <reedstrm@rice.edu> writes:
> While examining the output from ORDER BY queries, both using and not using
> an index, I came across a discrepancy: the explicit handling of NULLs in
> the tuplesort case always sorts NULLs to the end, regardless of direction
> of sort.

Yeah.  I think that's widely considered a bug --- we have a TODO item to
fix it.  You might care to dig in the archives for prior discussions.

> To make the direct sort the same as the index read would work for NULL,
> but for NaN would either require allowing NaN to be returned as >
> Infinity, which doesn't happen now,

Seems to me the sort order should be
-Infinitynormal values+Infinityother types of NaNNULL

and the reverse in a descending sort.

> or add another ordering operator that is only used for the sort case
> (use of '>' and '<' seems to be hardcoded all the way to the parser)

don't even think about that...
        regards, tom lane


pgsql-hackers by date:

Previous
From: "Ross J. Reedstrom"
Date:
Subject: Re: Re: [GENERAL] +/- Inf for float8's
Next
From: Don Baccus
Date:
Subject: Re: Bug tracking (was Re: +/- Inf for float8's)