Re: 8.3 vs HEAD difference in Interval output?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: 8.3 vs HEAD difference in Interval output?
Дата
Msg-id 4323.1223581367@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: 8.3 vs HEAD difference in Interval output?  (Kenneth Marshall <ktm@rice.edu>)
Ответы Re: 8.3 vs HEAD difference in Interval output?  (Ron Mayer <rm_pg@cheapcomplexdevices.com>)
Список pgsql-hackers
Kenneth Marshall <ktm@rice.edu> writes:
> There is a difference between the result 0.6 and 0.60 in rounding.
> The first is accurate +-0.05 and the second is +-0.005. Certainly,
> it does not seem unreasonable that machines can calulate intervals
> to the nearest 100th of a second. What is not clear to me is how the
> decision to stop at the 2nd decimal digit was reached.

Probably by flipping a coin ;-).  You have to remember that all this
behavior was designed around floating-point intervals, so there's
inherent imprecision in there; and the extent depends on the size of
the interval which makes it pretty hard to choose a display precision.

In the integer-timestamp world we know that the number is exact in
microseconds.  We clearly ought to be prepared to display up to six
fractional digits, but suppressing trailing zeroes in that seems
appropriate.

We could try to do the same in the float case, but I'm a bit worried
about finding ourselves showing "1234567.799999" where it should be
"1234567.8".
        regards, tom lane


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

Предыдущее
От: Kenneth Marshall
Дата:
Сообщение: Re: 8.3 vs HEAD difference in Interval output?
Следующее
От: "Kevin Grittner"
Дата:
Сообщение: Re: 8.3 vs HEAD difference in Interval output?