Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id DAC6E64FED7; Tue, 19 Aug 2008 02:14:31 -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 46189-01; Tue, 19 Aug 2008 02:14:19 -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 E277C64FCDE; Tue, 19 Aug 2008 02:14:16 -0300 (ADT) Received: by fetter.org (Postfix, from userid 500) id C2C9CFBC885; Mon, 18 Aug 2008 22:14:14 -0700 (PDT) Date: Mon, 18 Aug 2008 22:14:14 -0700 From: David Fetter To: Tatsuo Ishii Cc: pgsql-patches@postgresql.org, pgsql-hackers@postgresql.org Subject: Re: [HACKERS] WITH RECURSIVE patches 0818 Message-ID: <20080819051414.GI7447@fetter.org> References: <20080818.163852.105172778.t-ishii@sraoss.co.jp> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080818.163852.105172778.t-ishii@sraoss.co.jp> User-Agent: Mutt/1.5.18 (2008-05-17) 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: 200808/16 X-Sequence-Number: 6992 On Mon, Aug 18, 2008 at 04:38:52PM +0900, Tatsuo Ishii wrote: > Hi, > > Here is the latest WITH RECURSIVE patches against CVS HEAD. Besides > syncing to CVS HEAD, followings are main differences from previous > one: Thanks for the new patch :) I think I may have found another bug: WITH RECURSIVE t(i,j) AS ( VALUES (1,2) UNION ALL SELECT t2.i, t.j FROM ( SELECT 2 AS i UNION ALL /* Wrongly getting detected, I think */ SELECT 3 AS i ) AS t2 JOIN t ON (t2.i = t.i) ) SELECT * FROM t; ERROR: attribute number 2 exceeds number of columns 1 Is there some way to ensure that in the case of WITH RECURSIVE, the query to the right of UNION ALL follows only the SQL:2008 rules about not having outer JOINs, etc. in it, but otherwise make it opaque to the error-checking code? I know I didn't explain that well, but the above SQL should work and the error appears to stem from the parser's looking at the innermost UNION ALL instead of the outermost. 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