Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 173FA475DBD for ; Tue, 26 Nov 2002 12:15:05 -0500 (EST) Received: from anchor-post-39.mail.demon.net (anchor-post-39.mail.demon.net [194.217.242.80]) by postgresql.org (Postfix) with ESMTP id 421E0475C22 for ; Tue, 26 Nov 2002 12:15:03 -0500 (EST) Received: from mwynhau.demon.co.uk ([193.237.186.96] helo=mainbox.archonet.com) by anchor-post-39.mail.demon.net with esmtp (Exim 3.36 #2) id 18GjId-0005qo-0U; Tue, 26 Nov 2002 17:15:03 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by mainbox.archonet.com (Postfix) with ESMTP id B786A1752A; Tue, 26 Nov 2002 17:04:33 +0000 (GMT) Received: from archonet.com (localhost.localdomain [127.0.0.1]) by mainbox.archonet.com (Postfix) with SMTP id 20EAB16B69; Tue, 26 Nov 2002 17:04:33 +0000 (GMT) Received: from 192.168.1.16 (SquirrelMail authenticated user dev) by mainbox.archonet.com with HTTP; Tue, 26 Nov 2002 17:04:33 -0000 (GMT) Message-ID: <1081.192.168.1.16.1038330273.squirrel@mainbox.archonet.com> In-Reply-To: <20021126075031.N77510-100000@megazone23.bigpanda.com> References: <200211261041.50766.dev@archonet.com> <20021126075031.N77510-100000@megazone23.bigpanda.com> Date: Tue, 26 Nov 2002 17:04:33 -0000 (GMT) Subject: Re: Are sub-select error suppressed? From: dev@archonet.com To: "Stephan Szabo" Cc: "Richard Huxton" , "patrick" , pgsql-sql@postgresql.org X-Mailer: SquirrelMail (version 1.3.2) MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 X-Priority: 3 Importance: Normal X-Virus-Scanned: by AMaViS snapshot-20020531 X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200211/402 X-Sequence-Number: 10544 > On Tue, 26 Nov 2002, Richard Huxton wrote: > >> On Tuesday 26 Nov 2002 9:43 am, patrick wrote: >> > Greetings, >> > >> > I'm not sure what the correct behavior is here but the observed >> > behavior seems "wrong" (or at least undesirable). >> Don't look right to me, and I still see it here in 7.2 and the 7.3 beta >> I've >> got (note - not most recent). I don't think it's in the subselect itself >> - >> what's happening is when you do > > I think it's standard behavior. The column reference is an outer > reference I believe, IIRC all the names from the outer query are in scope > in the subselect (although if there's an equivalent name in the subselect > from tables you'd have to qualify it). Ah - of course. Otherwise you couldn't do a subselect where foo=outer_foo. It tries to bind within the subselect, fails, then binds to the outer clause. Obvious now Stephan's pointed it out. Also reminds me why I like table aliases for any complicated queries. - Richard Huxton