Re: BUG #2994: avg() calculates wrong on Interval-type

Поиск
Список
Период
Сортировка
От Peter Eisentraut
Тема Re: BUG #2994: avg() calculates wrong on Interval-type
Дата
Msg-id 200702130020.23365.peter_e@gmx.net
обсуждение исходный текст
Ответ на Re: BUG #2994: avg() calculates wrong on Interval-type  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: BUG #2994: avg() calculates wrong on Interval-type  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-bugs
Tom Lane wrote:
> "Frank F. Burmo" <fburmo@online.no> writes:
> > The following avg()-call gives me a result of: "2 days,
> > 27:53:49.359573"... which must be wrong. There are only 24 hours in
> > a day.
>
> That's a false premise.  Days and hours/minutes/seconds are
> independent components of an interval.

I don't understand how it does the computation then.  None of his input
data contains hour/minute/second components in excess of 24 hours, so
to arrive at 27-some hours it must have pulled over some days.

Moreover, my system thinks that the average of '1 day 12 hours' and '8
hours' is 22 hours, and also that the average of '2 days' and '3 days'
is 2 days and 12 hours, so it does make the assumption that 1 day = 24
hours.

--
Peter Eisentraut
http://developer.postgresql.org/~petere/

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: BUG #2994: avg() calculates wrong on Interval-type
Следующее
От: Tom Lane
Дата:
Сообщение: Re: BUG #2994: avg() calculates wrong on Interval-type