<Eugen(dot)Konkov(at)aldec(dot)com> writes:
>> Aliases in the select list are not in scope in the having clause.
> it will be good if aliases will be in scope of 'having' clause.
Feel free to try to convince the SQL standards committee ...
regards, tom lane