Re: [GENERAL] GROUP BY problem with 6.5

From: "Ross J(dot) Reedstrom" <reedstrm(at)wallace(dot)ece(dot)rice(dot)edu>
To: pgsql-general(at)postgreSQL(dot)org
Subject: Re: [GENERAL] GROUP BY problem with 6.5
Date: 1999-07-05 03:42:57
Message-ID: 19990704224257.A2681@wallace.ece.rice.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)rice(dot)edu>
NSBRI Research Scientist/Programmer
Computer and Information Technology Institute
Rice University, 6100 S. Main St., Houston, TX 77005

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Felix Morley Finch 1999-07-05 04:11:01 Curiousity about indexing, again
Previous Message Bruce Momjian 1999-07-05 03:19:24 Re: [GENERAL] GROUP BY problem with 6.5