Received: from localhost (unknown [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id 380242E031E for ; Mon, 17 Mar 2008 09:57:10 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 73074-02-3 for ; Mon, 17 Mar 2008 09:56:48 -0300 (ADT) Received: from mx1.hub.org (mx1.hub.org [200.46.204.176]) by postgresql.org (Postfix) with ESMTP id 53FB42E2EF5 for ; Mon, 17 Mar 2008 09:33:40 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from megafon.hr (megafon.hr [213.202.104.5]) by mx1.hub.org (Postfix) with ESMTP id 5258016D965D for ; Mon, 17 Mar 2008 09:30:34 -0300 (ADT) Received: from localhost (localhost.localdomain [127.0.0.1]) by megafon.hr (Postfix) with ESMTP id BE1BD250058 for ; Mon, 17 Mar 2008 13:04:51 +0100 (CET) X-Virus-Scanned: ClamAV at megafon.hr Received: from megafon.hr ([127.0.0.1]) by localhost (localhost.localdomain [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id YO1+57yKCfOV for ; Mon, 17 Mar 2008 13:04:43 +0100 (CET) Received: from [192.168.1.94] (unknown [213.147.122.162]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: mike) by megafon.hr (Postfix) with ESMTP id 8857625004D for ; Mon, 17 Mar 2008 13:04:42 +0100 (CET) Message-ID: <47DE5E5B.60203@megafon.hr> Date: Mon, 17 Mar 2008 13:04:43 +0100 From: Mario Splivalo User-Agent: Thunderbird 2.0.0.12 (X11/20080227) MIME-Version: 1.0 To: pgsql-sql@postgresql.org Subject: Re: Subselect strange behaviour - bug? References: <47DD5D3A.6060100@megafon.hr> <430.1205692088@sss.pgh.pa.us> In-Reply-To: <430.1205692088@sss.pgh.pa.us> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200803/92 X-Sequence-Number: 30420 Tom Lane wrote: > Mario Splivalo 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