Re: [HACKERS] SUM() and GROUP BY - Mailing list pgsql-hackers

From Thomas G. Lockhart
Subject Re: [HACKERS] SUM() and GROUP BY
Date
Msg-id 369D8A76.99B4A178@alumni.caltech.edu
Whole thread Raw
In response to Re: [HACKERS] SUM() and GROUP BY  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: [HACKERS] SUM() and GROUP BY  ("D'Arcy" "J.M." Cain <darcy@druid.net>)
List pgsql-hackers
> I suppose you could argue that this is consistent with cases 2 and 3,
> in a weird way, but it's certainly not the way I'd expect it to work.
> If there are no groups created by GROUP BY, then AVG should never be
> invoked at all, therefore there should be no rows returned.

Agreed.

> So, again I agree with D'Arcy.

I'm missing something. Is there another issue for GROUP BY for which we
don't have a consensus? An aggregate on an entire column can return
NULL, and aggregates on columns with GROUP BY columns of NULL should
not.

> But I'm not the one who might have
> to try to fix this...

And why not? :)
                   - Tom


pgsql-hackers by date:

Previous
From: Roland Roberts
Date:
Subject: Postgres 6.3.2 varchar <--> int4 conversions
Next
From: "Thomas G. Lockhart"
Date:
Subject: Re: [HACKERS] postgres and year 2000