Re: Re: round - timestamp bug

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Re: round - timestamp bug
Дата
Msg-id 28309.981560508@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: round - timestamp bug  (William Boyle <woboyle@ieee.org>)
Список pgsql-bugs
> Gonzalo Arana wrote:
>> radius=# create table x (x timestamp);
>> CREATE
>> radius=# insert into x (x) values ('Tue 23 Jan 21:38:59.997 2001');
>> INSERT 619178 1
>> radius=# select * from x;
>> x
>> ---------------------------------
>> Tue 23 Jan 21:38:60.00 2001 ART
>> (1 row)

This is just a display artifact.  The value stored is actually ... 59.997
(plus or minus a little bit from floating-point roundoff error) but the
seconds value is rounded to two digits during display.

I have suggested in the past that it'd be better to round the floating
value to two fractional digits before we break it down to date/hh/mm/ss,
rather than after, but that suggestion seems to have fallen on deaf
ears.

            regards, tom lane

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

Предыдущее
От: William Boyle
Дата:
Сообщение: Re: round - timestamp bug
Следующее
От: Thomas Lockhart
Дата:
Сообщение: Re: round - timestamp bug