Re: [HACKERS] Parser bug: alias is a "non-group column"? - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [HACKERS] Parser bug: alias is a "non-group column"?
Date
Msg-id 7640.926354331@sss.pgh.pa.us
Whole thread Raw
In response to Re: [HACKERS] Parser bug: alias is a "non-group column"?  (Bruce Momjian <maillist@candle.pha.pa.us>)
List pgsql-hackers
Bruce Momjian <maillist@candle.pha.pa.us> writes:
> Where did we leave this?

It's still broken.  I have the following notes in my todo list:

Inconsistent handling of attribute renaming:create table t1 (name text, value float8);select name as n1 from t1  where
n1 = 'one' ;ERROR:  attribute 'n1' not found
 
butSELECT name AS tempname, value FROM t1 GROUP BY name, value ;SELECT name AS tempname, value FROM t1 GROUP BY
tempname,value ;
 
both work.  Even stranger,SELECT name AS tempname, value FROM t1 GROUP BY name, valueHAVING value/AVG(value) >
0.75;ERROR: Illegal use of aggregates or non-group column in target list
 
(it thinks tempname is not in the GROUP BY list) butSELECT name AS tempname, value FROM t1 GROUP BY tempname,
valueHAVINGvalue/AVG(value) > 0.75;
 
works!  (6.4.2 has same behavior for all cases...)


Looks like the parser has some problems in the presence of column
renaming.  Since 6.4.2 has the same bug I doubt this qualifies as a
showstopper for 6.5; I have other todo items that I consider higher
priority.  If someone else wants to dig into this, be my guest...
        regards, tom lane


pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: [HACKERS] numeric & decimal
Next
From: Vadim Mikheev
Date:
Subject: Re: [HACKERS] INSERT INTO ... SELECT eats all my memory