Re: BUG: aliases does not work ((

From: <Eugen(dot)Konkov(at)aldec(dot)com>
To: "Peter Eisentraut" <peter_e(at)gmx(dot)net>, <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: BUG: aliases does not work ((
Date: 2008-05-07 16:15:58
Message-ID: 00b101c8b05d$a36213a0$1200a8c0@kharkov.localhost
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

> 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.
Because of dublicating code is cause of bugs when people foget replace code
in second place while changing code in first one =(

----- Original Message -----
From: "Peter Eisentraut" <peter_e(at)gmx(dot)net>
To: <pgsql-bugs(at)postgresql(dot)org>
Cc: <Eugen(dot)Konkov(at)aldec(dot)com>
Sent: Wednesday, May 07, 2008 2:52 PM
Subject: Re: [BUGS] BUG: aliases does not work ((

> Am Mittwoch, 7. Mai 2008 schrieb Eugen(dot)Konkov(at)aldec(dot)com:
>> SELECT
>> MIN(COALESCE(cmp_values(parent_td.value, parent_md.value,
>> parent_cmp.value),0)) as chk_parent, FROM some_table
>>
>> having chk_parent > 0
>>
>> ERROR: column "chk_parent" does not exist at character 2342
>
> Aliases in the select list are not in scope in the having clause. Either
> write out the expression again or use a subquery.

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2008-05-07 16:32:28 Re: BUG: aliases does not work ((
Previous Message Tom Lane 2008-05-07 15:09:43 Re: BUG #4148: tsearch related issue