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

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: BUG #2994: avg() calculates wrong on Interval-type
Дата
Msg-id 13275.1171314889@sss.pgh.pa.us
обсуждение исходный текст
Ответ на BUG #2994: avg() calculates wrong on Interval-type  ("Frank F. Burmo" <fburmo@online.no>)
Ответы Re: BUG #2994: avg() calculates wrong on Interval-type  (Peter Eisentraut <peter_e@gmx.net>)
Список pgsql-bugs
"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.  Some days have 23 or 25 hours, therefore
e.g. "48 hours" is not interchangeable with "2 days".  If you want to
assume it is, see justify_hours().

            regards, tom lane

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

Предыдущее
От: Magnus Hagander
Дата:
Сообщение: Re: BUG #2993: The program "postgres" is needed by initdb but was not found ...
Следующее
От: Peter Eisentraut
Дата:
Сообщение: Re: BUG #2994: avg() calculates wrong on Interval-type