Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 762B6B5DECB for ; Mon, 8 Aug 2011 15:15:10 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 17706-02-8 for ; Mon, 8 Aug 2011 18:15:04 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by mail.postgresql.org (Postfix) with ESMTP id 84D17B5DD1D for ; Mon, 8 Aug 2011 15:11:23 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id p78IBHvt009241; Mon, 8 Aug 2011 14:11:18 -0400 (EDT) To: "Kevin Grittner" cc: "ai" , pgsql-bugs@postgresql.org Subject: Re: BUG #6154: wrong result with nested left-joins In-reply-to: <4E3FD730020000250003FC3D@gw.wicourts.gov> References: <201108081313.p78DDX6W021751@wwwmaster.postgresql.org> <4E3FA39B020000250003FC1F@gw.wicourts.gov> <25701.1312815692@sss.pgh.pa.us> <01bc01cc55e0$4592ddf0$d0b899d0$@mail.ru> <4E3FD730020000250003FC3D@gw.wicourts.gov> Comments: In-reply-to "Kevin Grittner" message dated "Mon, 08 Aug 2011 12:31:44 -0500" Date: Mon, 08 Aug 2011 14:11:17 -0400 Message-ID: <9240.1312827077@sss.pgh.pa.us> From: Tom Lane 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/72 X-Sequence-Number: 30884 "Kevin Grittner" writes: > "ai" wrote: >> Oops.. I just saw, that I send you "correct" (already with > "workaround") >> sql-code instead of "wrong"... >> here is "wrong" (difference is in "SELECT sub3.key3, sub4.value2 > FROM" ): > OK, that is still happening, and looks wrong to me. Yeah, I see it too. It seems to be evaluating the placeholder for the COALESCE expression at the wrong join level. Not sure why, yet. regards, tom lane