Shouldn't this be invalid?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-hackers(at)postgreSQL(dot)org
Subject: Shouldn't this be invalid?
Date: 1999-05-02 00:09:27
Message-ID: 12529.925603767@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I notice that both 6.4.2 and 6.5-current make no complaint if I do

create table t1 (a int4, b int4);

select a+1,b from t1 group by b;

Shouldn't this draw "Illegal use of aggregates or non-group column in
target list"? It does if there's an aggregate nearby:

select sum(a),a+1,b from t1 group by b;
ERROR: Illegal use of aggregates or non-group column in target list
select sum(a),b from t1 group by b;
[ no problem ]

I think the system is simply failing to apply the check in the case
where there's a GROUP BY but no aggregate functions. Comments?

regards, tom lane

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 1999-05-02 04:29:18 query dumping core
Previous Message Tom Lane 1999-05-01 23:51:33 Re: [HACKERS] views and group by (formerly: create view as selec