Re: [BUGS] extract(epoch from infinity) is not 0

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [BUGS] extract(epoch from infinity) is not 0
Дата
Msg-id 10833.1310592156@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: [BUGS] extract(epoch from infinity) is not 0  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
Robert Haas <robertmhaas@gmail.com> writes:
> On Jul 13, 2011, at 1:43 PM, Bruce Momjian <bruce@momjian.us> wrote:
>> I see:
>> 
>> if (TIMESTAMP_NOT_FINITE(timestamp))
>> {
>>     result = 0;
>>     PG_RETURN_FLOAT8(result);
>> }
>> 
>> Does anyone object to changing this?

> It's sort of non-obvious that either behavior is better than the other. We might just be replacing one surprising
behaviorwith another.
 

Well, this code path is not much except a punt.  If we're going to touch
it we should think through the behavior for all field types, not just
epoch.

I think a reasonable case could be made for throwing error or returning
NaN (indicating "indeterminate") for most field types.  I can see
returning +/- infinity for epoch --- are there any others where that's
sane?
        regards, tom lane


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

Предыдущее
От: Josh Berkus
Дата:
Сообщение: Re: [BUGS] extract(epoch from infinity) is not 0
Следующее
От: Peter Geoghegan
Дата:
Сообщение: Reduced power consumption in WAL Writer process