Re: Limits of SQL - Mailing list pgsql-general

From Bruno Wolff III
Subject Re: Limits of SQL
Date
Msg-id 20050604202213.GA20567@wolff.to
Whole thread Raw
In response to Re: Limits of SQL  (Joachim Zobel <jzobel@heute-morgen.de>)
Responses Re: Limits of SQL
List pgsql-general
On Sat, Jun 04, 2005 at 21:53:24 +0200,
  Joachim Zobel <jzobel@heute-morgen.de> wrote:
> Am Samstag, den 04.06.2005, 07:38 -0500 schrieb Bruno Wolff III:
> > On Sat, Jun 04, 2005 at 11:31:02 +0200,
> >   Joachim Zobel <jzobel@heute-morgen.de> wrote:
> > >
> > > ... And it seems that
> > > a plain SELECT that tells me if a path exists is not possible...
> >
> > When 'WITH' gets implemented then you should be able to do this. I think
> > there was some recent talk about that, but I don't know if it is going to
> > make it in to 8.1. We'll know in about a month though.
>
> So WITH will allow recursion so I can walk the graph, right? Does this
> mean I can recursively join until a terminating condition is reached?

It can be used to compute transitive closures, which I think is what
you are really looking for.
If you look at the TODO page (http://www.postgresql.org/docs/faqs.TODO.html)
you will see two entries for WITH under Exotic Features:
Add SQL99 WITH clause to SELECT
Add SQL99 WITH RECURSIVE to SELECT

There is a short example of this on pages 439-440 of "SQL for Smarties"
second edition.

pgsql-general by date:

Previous
From: Joachim Zobel
Date:
Subject: Re: Limits of SQL
Next
From: Bruce Momjian
Date:
Subject: Re: Rollback on Error