Re: SUM()ming a view's column - Mailing list pgsql-general

From Jan Ploski
Subject Re: SUM()ming a view's column
Date
Msg-id 1188385.988213872922.JavaMail.jpl@remotejava
Whole thread Raw
In response to SUM()ming a view's column  (Jan Ploski <jpljpl@gmx.de>)
List pgsql-general
On Wed, Apr 25, 2001 at 04:26:14PM +0200, Jan Ploski wrote:
> Hello,
>
> I have run into the following problem:
>
> workunit=> select * from v_wutest;
>  estimate
> ----------
>      1650
>       100
> (2 rows)
>
> workunit=> select sum(estimate) from v_wutest;
>  sum
> ------
>  4950
>   100
> (2 rows)
>
>
>
> Here, v_wutest is a view which returns two rows. Shouldn't the SUM
> aggregate simply add these two values? To me, it looks like a bug.
> Isn't it one?
>
> I am using PostgreSQL 7.0.3 here.

I just upgraded to 7.1 release 1, and the problem disappeared.
Also, I found a bug in one of my own queries (a missing join
condition), but IMHO it should not have led to the anomaly pictured
above, anyway.

-JPL


pgsql-general by date:

Previous
From: Geoff Caplan
Date:
Subject: Newbie struggling to set $PGDATA
Next
From: Lieven Van Acker
Date:
Subject: Re: Joined table view - multiple delete action rule