Re: WITH RECURSIVE patches V0.1 TODO items - Mailing list pgsql-hackers

From Michael Meskes
Subject Re: WITH RECURSIVE patches V0.1 TODO items
Date
Msg-id 20080527101731.GC26436@feivel.credativ.de
Whole thread Raw
In response to Re: WITH RECURSIVE patches V0.1 TODO items  (Tatsuo Ishii <ishii@postgresql.org>)
List pgsql-hackers
On Tue, May 27, 2008 at 04:40:41PM +0900, Tatsuo Ishii wrote:
> - EXCEPT which has a recursive query name in the right hand operator
>   is not allowed
> 
> - function which has recursive query name as an operator is not
>   allowed
> 
> - subquery which includes a recursive query name is not allowed. Note
>   that in the most outer query in the WITH clause subquery which
>   includes a recursive query name is allowed
> 
> - query which has a selection list including recursive query name
>   and aggregate function is not allowed
> 
> - query which has a selection list including recursive query name
>   and HAVING clause
> 
> - query including recursive query name and INTERSECT ALL or EXCEPT
>   ALL is not allowed
> 
> - query including recursive query name and FULL OUTER JOIN is not
>   allowed
> 
> - outer join query is not allowed if the right hand side of LEFT OUTER
>   JOIN has recursive query name
> 
> - outer join query is not allowed if the left hand side of RIGHT OUTER
>   JOIN has recursive query name

Ah, the standard already has this. Tatsuo-san you might remember us
talking about negative subqueries. This is exactly the reason for most
of these rules. A recursively defined table referencing itself negativly
will only be evaluatable under special circumstances and with the right
set of data.

I take it all these rule refer to using the recursive query inside its
own definition. It's perfectly fine to use a recursively defined query
inside another with clause defining a different query as a subselect.

Michael
-- 
Michael Meskes
Email: Michael at Fam-Meskes dot De, Michael at Meskes dot (De|Com|Net|Org)
ICQ: 179140304, AIM/Yahoo: michaelmeskes, Jabber: meskes@jabber.org
Go VfL Borussia! Go SF 49ers! Use Debian GNU/Linux! Use PostgreSQL!


pgsql-hackers by date:

Previous
From: Michael Meskes
Date:
Subject: Re: WITH RECURSIVE patches V0.1 TODO items
Next
From: Magnus Hagander
Date:
Subject: Re: ERRORDATA_STACK_SIZE panic crashes on Windows