Re: Re: round - timestamp bug

Поиск
Список
Период
Сортировка
От Thomas Lockhart
Тема Re: Re: round - timestamp bug
Дата
Msg-id 3A817D4E.50E9A464@alumni.caltech.edu
обсуждение исходный текст
Ответ на round - timestamp bug  (Gonzalo Arana <garana@sinectis.com.ar>)
Список pgsql-bugs
> No, the behavior is not platform-specific.  I'm on HP-PA:

Hmm. Don't see that on my Linux box :(

We don't have regression tests which cover this case?

> The problem is that we round the fractional seconds part to two digits
> only after we've separated seconds from the other fields.  (I imagine
> the code is not even doing that explicitly, but leaving it to sprintf
> to do so.)  It would work better if we rounded the entire floating
> timestamp value to two fractional digits before we break it down,
> eg with
>         tstamp = rint(tstamp * 100.0) / 100.0;

Sure, that's a possibility. There is already a macro to help do that
sort of thing, but I've not jumped to this solution since we probably
should allow some kind of variable precision on date/time types.

                     - Thomas

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: byteain() doesn't parse correctly
Следующее
От: Tom Lane
Дата:
Сообщение: Re: postmaster grows