Re: Strange interval arithmetic

Поиск
Список
Период
Сортировка
От Michael Fuhr
Тема Re: Strange interval arithmetic
Дата
Msg-id 20051127154517.GA34720@winnie.fuhr.org
обсуждение исходный текст
Ответ на Strange interval arithmetic  (Christopher Kings-Lynne <chriskl@familyhealth.com.au>)
Ответы Re: Strange interval arithmetic  (Michael Fuhr <mike@fuhr.org>)
Список pgsql-hackers
On Sun, Nov 27, 2005 at 11:15:04PM +0800, Christopher Kings-Lynne wrote:
> What's going on here?  Some sort of integer wraparound?
[...]
> test=# select interval '2378234234 seconds';
>    interval
> --------------
>  596523:14:07
> (1 row)

Looks like the value is stuck at 2^31 - 1 seconds:

test=> select interval '2147483646 seconds';  -- 2^31 - 2  interval   
--------------596523:14:06
(1 row)

test=> select interval '2147483647 seconds';  -- 2^31 - 1  interval   
--------------596523:14:07
(1 row)

test=> select interval '2147483648 seconds';  -- 2^31  interval   
--------------596523:14:07
(1 row)

-- 
Michael Fuhr


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

Предыдущее
От: Christopher Kings-Lynne
Дата:
Сообщение: Strange interval arithmetic
Следующее
От: Andreas Pflug
Дата:
Сообщение: Re: Windows installation notes