Re: BUG #2477: Aggregate Integer divisors incorrectly yield integer-type quotient
В списке pgsql-bugs по дате отправления:
| От | Tom Lane |
|---|---|
| Тема | Re: BUG #2477: Aggregate Integer divisors incorrectly yield integer-type quotient |
| Дата | |
| Msg-id | 29738.1150081389@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | BUG #2477: Aggregate Integer divisors incorrectly yield integer-type quotient ("John Rylander" <rylander@prolexia.com>) |
| Список | pgsql-bugs |
"John Rylander" <rylander@prolexia.com> writes:
> When for some reason I did a sum/count instead of an avg, the result was
> always an integer (either 0 or 1):
What's your point? Postgres has always defined division of integers as
yielding an integer result. AFAICS this choice is fully sanctioned by
the SQL standard:
1) If the data type of both operands of a dyadic arithmetic opera-
tor is exact numeric, then the data type of the result is exact
numeric, with precision and scale determined as follows:
...
d) The precision and scale of the result of division is
implementation-defined.
(SQL92 6.12 <numeric value expression> syntax rule 1)
> Yet another maddening PostgreSQL bug/idiosyncrasy. Time for this boy to go
> to Oracle
Sayonara. Last I checked, they had a few idiosyncrasies too.
regards, tom lane
В списке pgsql-bugs по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера