Re: RFE: Column aliases in WHERE clauses

From: Jasen Betts <jasen(at)xnet(dot)co(dot)nz>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: RFE: Column aliases in WHERE clauses
Date: 2012-09-22 07:23:13
Message-ID: k3jp11$gpi$2@reversiblemaps.ath.cx
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 2012-09-18, Rafal Pietrak <rafal(at)zorro(dot)isa-geek(dot)com> wrote:
>
> Actual Tom's example(1):
> SELECT 1/x AS inverse FROM data WHERE x <> 0;
> extended to (2):
> SELECT 1/x AS inverse FROM data WHERE x <> 0 AND 1/x > 20;
> could be written by user as (3):
> SELECT 1/x AS inverse FROM data WHERE x <> 0 AND inverse > 20;
> but token/replaced to its form (2) before WHERE evaluation.

Macros are confusing:

select random()*10 as confusion from generate_series(1,10)
where confusion > 5;

--
⚂⚃ 100% natural

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Boszormenyi Zoltan 2012-09-22 07:29:22 Re: Curosity question regarding "LOCK" NOWAIT
Previous Message Jasen Betts 2012-09-22 06:46:21 Re: pg_dump slow on windows