Re: Syntax bug? Group by? - Mailing list pgsql-hackers

From Mark Woodward
Subject Re: Syntax bug? Group by?
Date
Msg-id 18218.24.91.171.78.1161117949.squirrel@mail.mohawksoft.com
Whole thread Raw
In response to Re: Syntax bug? Group by?  (Peter Eisentraut <peter_e@gmx.net>)
Responses Re: Syntax bug? Group by?  (Martijn van Oosterhout <kleptog@svana.org>)
List pgsql-hackers
> Mark Woodward wrote:
>> Shouldn't this work?
>>
>> select ycis_id, min(tindex), avg(tindex) from y where ycis_id = 15;
>>
>> ERROR:  column "y.ycis_id" must appear in the GROUP BY clause or be
>> used in an aggregate function
>
> This would require a great deal of special-casing, in particular
> knowledge of the = operator, and then the restriction to a particular
> form of the WHERE clause.  For overall consistency, I don't think this
> should be allowed.
>

Well, this started out as a "huh, that's funny, that should work, is that
a bug?" and is turning into a search through the SQL99 spec for a clear
answer. I've already worked around it, but to me, at least, it seems it
should work.


pgsql-hackers by date:

Previous
From: "Mark Woodward"
Date:
Subject: Re: Syntax bug? Group by?
Next
From: "Mark Woodward"
Date:
Subject: Re: Syntax bug? Group by?