Re: [HACKERS] 6.5.0 - Overflow bug in AVG( )

Поиск
Список
Период
Сортировка
От Thomas Lockhart
Тема Re: [HACKERS] 6.5.0 - Overflow bug in AVG( )
Дата
Msg-id 3767C2F6.CC011A4E@alumni.caltech.edu
обсуждение исходный текст
Ответ на RE: [HACKERS] 6.5.0 - Overflow bug in AVG( )  ("Jackson, DeJuan" <djackson@cpsgroup.com>)
Список pgsql-hackers
> What does the spec have to say?  It bothers me somewhat that an AVG is
> expected to return an integer result at all.  Isn't the Average of 1 and 2,
> 1.5 not 1?

Yeah, well, it's a holdover from the original Postgres code. We just
haven't made an effort to change it yet, but it seems a good candidate
for a makeover, no?

I'm pretty sure that the spec would suggest a float8 return value for
avg(int), but I haven't looked recently to refresh my memory.
               - Thomas

-- 
Thomas Lockhart                lockhart@alumni.caltech.edu
South Pasadena, California


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

Предыдущее
От: "Jackson, DeJuan"
Дата:
Сообщение: RE: [HACKERS] 6.5.0 - Overflow bug in AVG( )
Следующее
От: José Soares
Дата:
Сообщение: SET QUERY_LIMIT bug report