Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id C8943B5DBF3 for ; Mon, 8 Aug 2011 12:08:21 -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 63537-03 for ; Mon, 8 Aug 2011 15:08:15 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from smtp3.mail.ru (smtp3.mail.ru [94.100.176.131]) by mail.postgresql.org (Postfix) with ESMTP id 53540B5DBF2 for ; Mon, 8 Aug 2011 12:08:15 -0300 (ADT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mail.ru; s=mail; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID:Date:Subject:In-Reply-To:References:Cc:To:From; bh=zsgR/wqU6WfSVugHzP7Q/+/VaaL8OBnd47x3DScT3Hc=; b=eiinV3m4oNVPcHIX1Npvqyo2cQztBv+kgMCHP9pM/iHJiPpQK6FDxKFS5bH5HU8j1oXCr+FQ4s3Oj9F3xT72PpjUfHBoZ5kZLdi5zPP2vtxx3AXcBw2HvPknzSxW0b+S; Received: from [180.183.160.156] (port=28629 helo=ws) by smtp3.mail.ru with asmtp id 1QqRR6-00014u-00; Mon, 08 Aug 2011 19:08:13 +0400 From: "ai" To: "'Tom Lane'" , "'Kevin Grittner'" Cc: References: <201108081313.p78DDX6W021751@wwwmaster.postgresql.org> <4E3FA39B020000250003FC1F@gw.wicourts.gov> <25701.1312815692@sss.pgh.pa.us> In-Reply-To: <25701.1312815692@sss.pgh.pa.us> Subject: Re: BUG #6154: wrong result with nested left-joins Date: Mon, 8 Aug 2011 22:08:05 +0700 Message-ID: <01bb01cc55dc$fdd78db0$f986a910$@mail.ru> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Outlook 14.0 Thread-Index: AQKtBagl8fgbDVr+0xwL5rgFD0w44gLDzn4lAgnuvfiTK0AKQA== Content-Language: ru X-Spam: Not detected X-Mras: Ok X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.899 tagged_above=-5 required=5 tests=BAYES_00=-1.9, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001 X-Spam-Level: X-Archive-Number: 201108/68 X-Sequence-Number: 30880 SELECT VERSION(); produces "PostgreSQL 8.4.5 on x86_64-pc-linux-gnu, compiled by GCC x86_64-pc-linux-gnu-gcc (Gentoo 4.4.4-r2 p1.3, pie-0.4.5) 4.4.4, 64-bit" Best regards, Alex -----Original Message----- From: Tom Lane [mailto:tgl@sss.pgh.pa.us] Sent: Monday, August 08, 2011 10:02 PM To: Kevin Grittner Cc: listar; pgsql-bugs@postgresql.org Subject: Re: [BUGS] BUG #6154: wrong result with nested left-joins "Kevin Grittner" writes: > "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. It works for me too in 8.4.recent; but I believe the relevant fix is in 8.4.5, which makes me doubt the OP's report of his server version. http://git.postgresql.org/gitweb/?p=postgresql.git&a=commitdiff&h=dc9cc887b7 4bfa0d40829c4df66dead509fdd8f6 regards, tom lane