Re: min() and NaN

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: min() and NaN
Дата
Msg-id 15160.1058902399@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: min() and NaN  (Bruce Momjian <pgman@candle.pha.pa.us>)
Ответы Re: min() and NaN  (Bruce Momjian <pgman@candle.pha.pa.us>)
Re: min() and NaN  (Greg Stark <gsstark@mit.edu>)
Список pgsql-sql
Bruce Momjian <pgman@candle.pha.pa.us> writes:
> Well, my 2 cents is that though we consider NULL when ordering via ORDER
> BY, we ignore it in MAX because it really isn't a value, and NaN seems
> to be similar to NULL.

Good idea, but I don't think we can get away with it.  The spec says
that MAX/MIN have to be consistent with the comparison operators (and
therefore with ORDER BY):
           iii) If MAX or MIN is specified, then the result is respec-                tively the maximum or minimum
valuein TXA. These results                are determined using the comparison rules specified in
Subclause8.2, "<comparison predicate>".
 

NULL can be special, because it acts specially in comparisons anyway.
But NaN is just a value of the datatype.

I'd be willing to go against the spec if I thought that having
ignore-NaNs behavior was sufficiently important, but I don't think it's
important enough to disregard the spec...
        regards, tom lane


В списке pgsql-sql по дате отправления:

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: min() and NaN
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: min() and NaN