BUG #3991: pgsql function sum()

Поиск
Список
Период
Сортировка
От mirek
Тема BUG #3991: pgsql function sum()
Дата
Msg-id 200802261025.m1QAPYcS093863@wwwmaster.postgresql.org
обсуждение исходный текст
Ответы Re: BUG #3991: pgsql function sum()  (Zdenek Kotala <Zdenek.Kotala@Sun.COM>)
Re: BUG #3991: pgsql function sum()  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-bugs
The following bug has been logged online:

Bug reference:      3991
Logged by:          mirek
Email address:      mirek@mascort.com.pl
PostgreSQL version: 8.2.4
Operating system:   Linux fedora(for work) and windows(for development)
Description:        pgsql function sum()
Details:

I saw a very strange behavior when i used function SUM() in query (used
inside pg function), query:

select magazyn, ciag, numer, datawp, vat, sum(wnetto-wnettop) as wn,
sum(wvat-wvatp) as wv, sum(wbrutto-wbruttop) as wb from vzk_pozycjezinfo
where magazyn = $1 and ciag = $2 and numer = $3 and datawp = $4
group by magazyn, ciag, numer, datawp, vat
order by magazyn, ciag, numer, datawp, vat

vzk_pozycjezinfo is view

problem is in: sum(wvat-wvatp) where field in view wvat = 33.08 and wvatp =
36.09
Result is -3.01000000000001

If I ask postgres manualy: select sum(33.08 - 36.09)
result is ok -3.01

Now I fix it with round function but i think that is a bug.

With regards
Mirek

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

Предыдущее
От: Magnus Hagander
Дата:
Сообщение: Re: BUG #3985: select command not working
Следующее
От: "spol@mail.ru"
Дата:
Сообщение: help me plz with 2 postgres users