Re: WITH RECURSIVE patches 0818 - Mailing list pgsql-hackers

From David Fetter
Subject Re: WITH RECURSIVE patches 0818
Date
Msg-id 20080823062209.GH11254@fetter.org
Whole thread Raw
In response to Re: WITH RECURSIVE patches 0818  (Tatsuo Ishii <ishii@postgresql.org>)
Responses Re: WITH RECURSIVE patches 0818
List pgsql-hackers
On Sat, Aug 23, 2008 at 11:33:13AM +0900, Tatsuo Ishii wrote:
> > 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.
>
> Here is new patches fixing the bug you pointed out (patches was
> created by Yoshiyuki). Also I added your SQL to the regression test,
> and now the patches is against CVS HEAD. For your convenience I also
> include patches against the previous version.

Thanks :)

Any progress on the READMEs for this?

Also, now that we are into August, would Asaba-san and whomever else
like to try out the git repository?  To do so, I just need a login
name and a public key.

Cheers,
David.
--
David Fetter <david@fetter.org> 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

pgsql-hackers by date:

Previous
From: "Pavel Stehule"
Date:
Subject: Re: proposal sql: labeled function params
Next
From: Tatsuo Ishii
Date:
Subject: Re: WITH RECURSIVE patches 0818