Re: Subselect strange behaviour - bug?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Mario Splivalo <mario(dot)splivalo(at)megafon(dot)hr>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Subselect strange behaviour - bug?
Date: 2008-03-16 18:28:08
Message-ID: 430.1205692088@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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);

regards, tom lane

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Mario Splivalo 2008-03-17 12:04:43 Re: Subselect strange behaviour - bug?
Previous Message Mario Splivalo 2008-03-16 17:47:38 Subselect strange behaviour - bug?