Re: WITH RECURSIVE patches V0.1 TODO items

From: Michael Meskes <meskes(at)postgresql(dot)org>
To: Tatsuo Ishii <ishii(at)postgresql(dot)org>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: WITH RECURSIVE patches V0.1 TODO items
Date: 2008-05-27 10:17:31
Message-ID: 20080527101731.GC26436@feivel.credativ.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)jabber(dot)org
Go VfL Borussia! Go SF 49ers! Use Debian GNU/Linux! Use PostgreSQL!

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Magnus Hagander 2008-05-27 12:24:42 pgsql: Explicitly bind gettext() to the UTF8 locale when in use.
Previous Message Michael Meskes 2008-05-27 10:11:54 Re: WITH RECURSIVE patches V0.1 TODO items