Re: [GENERAL] GROUP BY problem with 6.5 - Mailing list pgsql-general

From Ross J. Reedstrom
Subject Re: [GENERAL] GROUP BY problem with 6.5
Date
Msg-id 19990704224257.A2681@wallace.ece.rice.edu
Whole thread Raw
In response to Re: [GENERAL] GROUP BY problem with 6.5  (Bruce Momjian <maillist@candle.pha.pa.us>)
Responses Re: [GENERAL] GROUP BY problem with 6.5
List pgsql-general
On Sun, Jul 04, 1999 at 11:19:24PM -0400, Bruce Momjian wrote:
> > I have a query which worked OK until now (with all the previous versions
> > of PostgreSQL) but now it returns the following error message:
> >
> > 'Illegal use of aggregates or non-group column in target list'
> >
> > So what has been changed at GROUP BY in 6.5?
> >
> >
>
> The target list can contain only aggregates(ie sum), or grouped by
> columns.
>

As per the SQL spec. I believe prior to 6.5, postgresql wasn't picky, and
let you get away with having other fields returned. The problem with that
is you got essentially a _random_ choice of value for that field.

So, the short answer is yes, it used to work, no PG's not broken, your SQL
is. Yes, that sucks, but no-one is making you upgrade. If you don't like it,
you can have double your money back ;-) If you really need it to work for
some insane reason, I bet you could throw money at postgresql.com and they
could come up with patches to put the old behavior back, for sufficently
large amounts of money.

Ross
--
Ross J. Reedstrom, Ph.D., <reedstrm@rice.edu>
NSBRI Research Scientist/Programmer
Computer and Information Technology Institute
Rice University, 6100 S. Main St.,  Houston, TX 77005

pgsql-general by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: [GENERAL] GROUP BY problem with 6.5
Next
From: Felix Morley Finch
Date:
Subject: Curiousity about indexing, again