Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id 4BB95F497B9 for ; Mon, 27 Feb 2012 10:26:19 -0400 (AST) Received: from andy.depesz.com ([88.198.47.100] helo=depesz.com) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1S21Wq-0003uZ-IX for pgsql-bugs@postgresql.org; Mon, 27 Feb 2012 14:26:17 +0000 Received: from andy.depesz.com ([88.198.47.100] helo=depesz.com) by depesz.com with esmtpa (Exim 4.77) (envelope-from ) id 1S21Wc-0003gZ-KH; Mon, 27 Feb 2012 15:26:02 +0100 Date: Mon, 27 Feb 2012 15:26:02 +0100 From: hubert depesz lubaczewski To: anisimovt@gmail.com Cc: pgsql-bugs@postgresql.org Subject: Re: BUG #6490: Not checking column existence in sub query Message-ID: <20120227142602.GA12584@depesz.com> Reply-To: depesz@depesz.com References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201202/190 X-Sequence-Number: 32533 On Mon, Feb 27, 2012 at 11:39:55AM +0000, anisimovt@gmail.com wrote: > The following bug has been logged on the website: > > Bug reference: 6490 > Logged by: Timofey Anisimov > Email address: anisimovt@gmail.com > PostgreSQL version: 9.1.2 > Operating system: Linux > Description: > > SELECT * FROM table1 where col1 in (select col2 from table2) > > if col2 exist in table1 and not exist in table2 there will be no error and > query output all rows from table1; sure. it is so called "correlated subquery" and it's definitely not a bug. Best regards, depesz -- The best thing about modern society is how easy it is to avoid contact with it. http://depesz.com/