Re: Refactoring the Type System

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Refactoring the Type System
Дата
Msg-id 10464.1289749663@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Refactoring the Type System  (Daniel Farina <drfarina@acm.org>)
Ответы Re: Refactoring the Type System  (Daniel Farina <drfarina@acm.org>)
Список pgsql-hackers
Daniel Farina <drfarina@acm.org> writes:
> Here are some weaknesses in the SUM aggregate that run up against the
> type system. Maybe they'll help crystallize some discussion:

> SUM(int2) => int4
> SUM(int4) => int8
> SUM(int8) => numeric

> Some weaknesses:

> SUM, of any precision, assumes that the precision being accumulated
> into (which is also the return-precision) is enough to avoid overflow.

This is not a flaw of the type system, it's just an implementation
choice in the SUM() aggregates.  We could easily have chosen wider
accumulation and/or result types.
        regards, tom lane


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: [COMMITTERS] pgsql: Improved parallel make support
Следующее
От: Tom Lane
Дата:
Сообщение: Re: POSIX shared memory redux