column alias and group by/having/order - Mailing list pgsql-sql

From Tomasz Myrta
Subject column alias and group by/having/order
Date
Msg-id 402CD27E.7050001@klaster.net
Whole thread Raw
Responses Re: column alias and group by/having/order
Re: column alias and group by/having/order
List pgsql-sql
Hi
I found some strange column alias behaviour:

select val1+val2 as val
from some_table
group by val;

result - OK

select val1+val2 as val
from some_table
order by val;

result - OK

select val1+val2 as val
from some_table
group by val having val1+val2>1;

result - OK

select val1+val2 as val
from some_table
group by val having val>1;
ERROR:  Attribute "val" not found

Is it a bug or a feature?

Regards,
Tomasz Myrta

----------------------------------------------------------------------------------------------------------------
PostgreSQL7.3.4 on i386-pc-linux-gnu, compiled by GCC i386-linux-gcc 
 
(GCC) 3.3.2 20031005 (Debian prerelease)


pgsql-sql by date:

Previous
From: "David"
Date:
Subject: arrays and polygons
Next
From: Rod Taylor
Date:
Subject: Re: column alias and group by/having/order