On Mon, 2008-09-08 at 21:13 +0100, Gregory Stark wrote:
> Jeff Davis <[EMAIL PROTECTED]> writes:
> 
> > * Mutual Recursion:
> >
> >   with recursive
> >     foo(i) as (values(1) union all select i+1 from bar where i < 10),
> >     bar(i) as (values(1) union all select i+1 from foo where i < 10)
> >   select * from foo;
> >   ERROR:  mutual recursive call is not supported
> >
> >   The standard allows mutual recursion.
> 
> This seems to be a point of confusion. I originally read the standard and
> concluded that mutual recursion was an optional feature. Itagaki-san showed me
> a copy of the spec where it seemed there was a clear blanket prohibition on
> mutually recursive queries and in fact anything but simple linearly expandable
> queries. I wonder if there are different versions of the spec floating around
> on this point.
> 
> Take a second look at your spec and read on to where it defines "linear" and
> "expandable". If it doesn't define those terms then it's definitely different
> from what I read. If it does, read on to see what it does with them. The main
> reason to define them appeared to be to use them to say that supporting mutual
> recursion is not required.

I think we're reading the same version of the spec. I'm reading 200n.

My interpretation (Syntax Rule 2.h) is that expandable is only used to
determine whether it can contain a <search or cycle>.

That being said, I don't think it should be a requirement for 8.4. The
CTE patch is an important feature, and we shouldn't hold it up over
something comparatively obscure like mutual recursion. As Andrew Gierth
cited, other systems don't support it anyway. It should be kept in mind
for future work though.

Regards,
        Jeff Davis


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to