Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 50A4D6501CB; Fri, 18 Jul 2008 12:19:38 -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 42903-02; Fri, 18 Jul 2008 12:19:33 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from fetter.org (start.fetter.org [66.92.188.65]) by postgresql.org (Postfix) with ESMTP id 9BC856502AF; Fri, 18 Jul 2008 12:13:09 -0300 (ADT) Received: by fetter.org (Postfix, from userid 500) id 9F0B9FBC30E; Fri, 18 Jul 2008 08:13:08 -0700 (PDT) Date: Fri, 18 Jul 2008 08:13:08 -0700 From: David Fetter To: Tatsuo Ishii Cc: pgsql-patches@postgresql.org, pgsql-hackers@postgresql.org, y-asaba@sraoss.co.jp Subject: Re: [PATCHES] WITH RECUSIVE patches 0717 Message-ID: <20080718151308.GT28307@fetter.org> References: <20080717.184025.85407905.t-ishii@sraoss.co.jp> <20080717160115.GE28307@fetter.org> <20080718.104120.08328518.t-ishii@sraoss.co.jp> <20080718145608.GS28307@fetter.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080718145608.GS28307@fetter.org> User-Agent: Mutt/1.5.18 (2008-05-17) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.006 tagged_above=0 required=5 tests=AWL=0.006 X-Spam-Level: X-Archive-Number: 200807/865 X-Sequence-Number: 121125 On Fri, Jul 18, 2008 at 07:56:09AM -0700, David Fetter wrote: > On Fri, Jul 18, 2008 at 10:41:20AM +0900, Tatsuo Ishii wrote: > > > > Here is the lastest WITH RECURSIVE patches against CVS HEAD created by > > > > Yoshiyuki Asaba and minor corrections by Tatsuo Ishii. > > > > > > I tried this patch vs. CVS HEAD used my usual configure option with > > > only --with-prefix set, then tried to make, and got: > > > > > > make[3]: *** No rule to make target `parse_cte.o', needed by `objfiles.txt'. Stop. > > > make[3]: Leaving directory `/home/shackle/pgsql/src/backend/parser' > > > make[2]: *** [parser-recursive] Error 2 > > > make[2]: Leaving directory `/home/shackle/pgsql/src/backend' > > > make[1]: *** [all] Error 2 > > > make[1]: Leaving directory `/home/shackle/pgsql/src' > > > make: *** [all] Error 2 > > > > > > Is there something missing? > > > > Oops. I forgot to include patches against newly added files. Please > > try included patches. > > This now compiles. > > I have a test case that hangs and smashes. > > WITH t(i) AS ( > SELECT * FROM generate_series(1,5) > ) > SELECT > t1.i, > 2*t2.i > FROM > t AS t1 > JOIN > t AS t2 USING(i); > > server closed the connection unexpectedly > This probably means the server terminated abnormally > before or while processing the request. > The connection to the server was lost. Attempting reset: Failed. > > An equivalent query without RECURSIVE breaks in a different, in some > sense even more severe, way, as in it just hands out a wrong result > set: D'oh! That's what I get for sending this before waking up. It works just fine. > While this case is trivial, others are not. For example, if someone > wishes to do a k-deep summary on a parts explosion n levels deep, > n>k, one way to do this would be to JOIN the k-deep part of the path > enumeration to the parts greater than k deep. > > What would need to be fixed in order to make the above things work? Cheers, David. -- David Fetter http://fetter.org/ Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!: dfetter Skype: davidfetter XMPP: david.fetter@gmail.com Remember to vote! Consider donating to Postgres: http://www.postgresql.org/about/donate