X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id B083411F6067 for ; Fri, 28 Apr 2006 13:29:58 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 48248-10 for ; Fri, 28 Apr 2006 13:29:52 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from mail.logix-tt.com (unknown [212.211.145.186]) by postgresql.org (Postfix) with ESMTP id 97D8211F605C for ; Fri, 28 Apr 2006 13:29:51 -0300 (ADT) Received: from kingfisher.intern.logix-tt.com (T9c46.t.pppool.de [89.55.156.70]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.logix-tt.com (Postfix) with ESMTP id 60BBD656C8; Fri, 28 Apr 2006 18:30:56 +0200 (CEST) Received: from [127.0.0.1] (localhost [127.0.0.1]) by kingfisher.intern.logix-tt.com (Postfix) with ESMTP id 4F15C184C9BC0; Fri, 28 Apr 2006 18:30:08 +0200 (CEST) Message-ID: <44524310.70906@logix-tt.com> Date: Fri, 28 Apr 2006 18:30:08 +0200 From: Markus Schaber Organization: Logical Tracking and Tracing International AG, Switzerland User-Agent: Debian Thunderbird 1.0.7 (X11/20051017) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Tom Lane Cc: PostgreSQL SQL List Subject: Re: Slightly confused error message References: <44523BF1.1080307@logix-tt.com> <1612.1146240424@sss.pgh.pa.us> In-Reply-To: <1612.1146240424@sss.pgh.pa.us> X-Enigmail-Version: 0.93.0.0 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200604/208 X-Sequence-Number: 25017 Hi, Tom, Tom Lane wrote: >>I just stumbled over a slightly confused error message: > >>mydb=# select count(*),coverage_area from myschema.streets except select >>cd as coverage_area from countryref.disks group by streets.coverage_area; >>ERROR: column "streets.coverage_area" must appear in the GROUP BY >>clause or be used in an aggregate function > >>As the query looks, streets.coverage_area is actually used in the GROUP BY. > > The complaint is 100% accurate; I know that, and won't deny. > the subquery that it's unhappy about is > > select count(*),coverage_area from myschema.streets > > which is an aggregating query, but coverage_area is being used outside > an aggregate without having been grouped by. Yes, and my question is whether it is easy and worth the effort. to add that information (about the acutally offending subquery) to the message. Thanks, Markus -- Markus Schaber | Logical Tracking&Tracing International AG Dipl. Inf. | Software Development GIS Fight against software patents in EU! www.ffii.org www.nosoftwarepatents.org