Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id DD44A6500D5 for ; Mon, 28 Jul 2008 14:06:57 -0300 (ADT) Received: from postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 18791-04; Mon, 28 Jul 2008 14:06:53 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 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 postgresql.org (Postfix) with ESMTP id 91CA564FF2F; Mon, 28 Jul 2008 14:06:54 -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 m6SH6rMk023483; Mon, 28 Jul 2008 13:06:53 -0400 (EDT) To: Andrew Gierth cc: Tatsuo Ishii , pgsql-hackers@postgresql.org Subject: Re: WITH RECUSIVE patches 0723 In-reply-to: <877ib6rq6q.fsf@news-spur.riddles.org.uk> References: <20080725001513.GF16438@fetter.org> <20080725.092652.105178884.t-ishii@sraoss.co.jp> <87r69gs967.fsf@news-spur.riddles.org.uk> <20080728.162925.23020498.t-ishii@sraoss.co.jp> <877ib6rq6q.fsf@news-spur.riddles.org.uk> Comments: In-reply-to Andrew Gierth message dated "Mon, 28 Jul 2008 16:20:13 +0100" Date: Mon, 28 Jul 2008 13:06:53 -0400 Message-ID: <23482.1217264813@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200807/1310 X-Sequence-Number: 121570 Andrew Gierth writes: > "Tatsuo" == Tatsuo Ishii writes: > Tatsuo> Included patches from Yoshiyuki should fix 1) and 2). I also > Tatsuo> add your SQLs to the regression test. Thanks. > I think it needs this change in addition; without it, incorrect > results are returned when you reference a recursive view from within > the recursive query, due to the RecursionScan nodes becoming linked to > the wrong tuplestores. That whole business of using the EState to pass tuplestores back and forth looks fundamentally broken to me anyway; there's just no way it'll be certain to link the right nodes together in complicated cases with multiple recursions. The nodes should be carrying IDs (such as the name of the WITH item) which they use to search a lookaside list. regards, tom lane