Re: [HACKERS] Sum aggregate calculation for single precsion real
В списке pgsql-hackers по дате отправления:
| От | Tom Lane |
|---|---|
| Тема | Re: [HACKERS] Sum aggregate calculation for single precsion real |
| Дата | |
| Msg-id | 12546.1487133938@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | Re: [HACKERS] Sum aggregate calculation for single precsion real (Robert Haas <robertmhaas@gmail.com>) |
| Ответы |
Re: [HACKERS] Sum aggregate calculation for single precsion real
|
| Список | pgsql-hackers |
Robert Haas <robertmhaas@gmail.com> writes:
> Well put. Although it's worth noting that we aren't 100% consistent
> about this stuff: sum(smallint), sum(integer), and sum(bigint) all use
> an output data type different from the input data type, but other
> versions of sum() don't.
In those cases I believe the main reason for the different output type is
that there's a significant risk of overflow if we don't. See commits
bec98a31c and 5f7c2bdb5 for some history.
You could perhaps make an argument that sum(float4) would have less risk
of overflow if it accumulated in and returned float8, but frankly that
seems a bit thin.
regards, tom lane
В списке pgsql-hackers по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера