Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YC9FK-0002Jf-91 for pgsql-bugs@arkaria.postgresql.org; Fri, 16 Jan 2015 15:55:38 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1YC9FJ-0002Oz-Pj for pgsql-bugs@arkaria.postgresql.org; Fri, 16 Jan 2015 15:55:37 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1YC9FJ-0002Ot-6o for pgsql-bugs@postgresql.org; Fri, 16 Jan 2015 15:55:37 +0000 Received: from mail.anarazel.de ([217.115.131.40]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YC9FF-0008Tb-6i for pgsql-bugs@postgresql.org; Fri, 16 Jan 2015 15:55:36 +0000 Received: from intern.anarazel.de (p5DDC6CF7.dip0.t-ipconnect.de [93.220.108.247]) (Authenticated sender: andres@anarazel.de) by mail.anarazel.de (Postfix) with ESMTPSA id 652BE860002; Fri, 16 Jan 2015 16:55:32 +0100 (CET) Date: Fri, 16 Jan 2015 16:55:31 +0100 From: Andres Freund To: Kevin Perais Cc: Tom Lane , "pgsql-bugs@postgresql.org" Subject: Re: BUG #12556: Clause IN and NOT IN buggy Message-ID: <20150116155531.GF21581@alap3.anarazel.de> References: <20150115112720.2502.55131@wrigleys.postgresql.org> <6445.1421341526@sss.pgh.pa.us> <46C6B6B27EF7AA489BBDF478BF05B5D2BD886818@server.exchange.local> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <46C6B6B27EF7AA489BBDF478BF05B5D2BD886818@server.exchange.local> X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org On 2015-01-16 09:17:43 +0000, Kevin Perais wrote: > There is enough info to understand what goes wrong. I've run enough queries to inspect data. *You* want something. The likelihood of getting something fixed is far larger if you present an example that we can actually run. We obviously haven't seen the problem ourselves so far, so a testcase is crucial. We don't even have the actual table definitions, so we really can't say much. We really need a SQL script that allows us to reproduce these cases. > The fact that the query with IN does not returns the same result as > the JOIN knowing that there are NULL values proves it. I guess you mean 'no NULL values'? The second problem is perfectly explained by Tom's remark about NOT IN(...) returning NULL if *any* of the contained values are NULL. E.g. SELECT 1 WHERE 1 NOT IN (1, NULL); won't return any rows. Greetings, Andres Freund -- Andres Freund http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs