Re: Slightly confused error message - Mailing list pgsql-sql

From Markus Schaber
Subject Re: Slightly confused error message
Date
Msg-id 44524310.70906@logix-tt.com
Whole thread Raw
In response to Re: Slightly confused error message  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Slightly confused error message  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-sql
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


pgsql-sql by date:

Previous
From: Tom Lane
Date:
Subject: Re: Slightly confused error message
Next
From: Martin Marques
Date:
Subject: Re: Slightly confused error message