Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id D909AB5DBD5 for ; Mon, 8 Aug 2011 10:51:52 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 68641-09 for ; Mon, 8 Aug 2011 13:51:46 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from gw.wicourts.gov (gwmta.wicourts.gov [165.219.244.99]) by mail.postgresql.org (Postfix) with ESMTP id A951EB5DBCC for ; Mon, 8 Aug 2011 10:51:46 -0300 (ADT) Received: from Courts-MTA by gw.wicourts.gov with Novell_GroupWise; Mon, 08 Aug 2011 08:51:44 -0500 Message-Id: <4E3FA39B020000250003FC1F@gw.wicourts.gov> X-Mailer: Novell GroupWise Internet Agent 8.0.1 Date: Mon, 08 Aug 2011 08:51:39 -0500 From: "Kevin Grittner" To: "listar" , Subject: Re: BUG #6154: wrong result with nested left-joins References: <201108081313.p78DDX6W021751@wwwmaster.postgresql.org> In-Reply-To: <201108081313.p78DDX6W021751@wwwmaster.postgresql.org> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.711 tagged_above=-5 required=5 tests=BAYES_00=-1.9, RP_MATCHES_RCVD=-0.811 X-Spam-Level: X-Archive-Number: 201108/64 X-Sequence-Number: 30876 "listar" wrote: > PostgreSQL version: 8.4.5 > Description: wrong result with nested left-joins > And this is the problem - value2 can't be NULL because of COALESCE > in sub4 (at least I think that it can't be =)) This works correctly in release 9.0.4 and development HEAD. I don't still have any machines handy which are running 8.4, but you might want to try it on the latest bug-fix version of 8.4 (currently 8.4.8) to see if the fix was back-patched. http://www.postgresql.org/support/versioning -Kevin