Skip site navigation (1) Skip section navigation (2)

Re: Subselect strange behaviour - bug?

From: Mario Splivalo <mario(dot)splivalo(at)megafon(dot)hr>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: Subselect strange behaviour - bug?
Date: 2008-03-17 12:04:43
Message-ID: 47DE5E5B.60203@megafon.hr (view raw or flat)
Thread:
Lists: pgsql-sql
Tom Lane wrote:
> Mario Splivalo <mario(dot)splivalo(at)megafon(dot)hr> writes:
>   
>> And here is the 'problematic' query:
>> melem=# select * from t2 where id1 in (select id1 from t1);
>>     
>> I guess postgres should tell me that column name id1 is nonexistant in
>> table t1.
>>     
>
> No, it shouldn't, because that's a perfectly legal outer reference;
> that is, what you wrote is equivalent to
> 	select * from t2 where id1 in (select t2.id1 from t1);
>
>   
Huh, you're right. Appologies for the noise :)

    Mario

In response to

pgsql-sql by date

Next:From: Chadwick HornDate: 2008-03-18 01:20:15
Subject: postgres server crashes unexpectedly
Previous:From: Tom LaneDate: 2008-03-16 18:28:08
Subject: Re: Subselect strange behaviour - bug?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group