Re: [Fwd: SQL3 recursive unions] - Mailing list pgsql-general

From Michael Meskes
Subject Re: [Fwd: SQL3 recursive unions]
Date
Msg-id 20000617141723.A16029@fam-meskes.de
Whole thread Raw
In response to [Fwd: SQL3 recursive unions]  (Ron Peterson <rpeterson@yellowbank.com>)
List pgsql-general
On Thu, Jun 15, 2000 at 03:58:40PM -0400, Ron Peterson wrote:
> PostgreSQL's TODO list (http://www.postgresql.org/docs/todo.html) makes
> reference to implementing SQL3 recursive queries.  Where does this task
> fall in the overall priority of things?  I hate to just whine without

I want to implement this for some years now. But I haven't found the time to
even start yet.

> offering to help, but I think this would be a rather big bite to chew.
> (Actually, I would be happy to help, if anyone had any suggestions about
> what I might be able to do)

So at least we are two who are interested in this.

> Here's an example from DB2's documentation, cleaned up a bit:

Is this SQL3 syntax?

> with rpl (part, subpart, quantity) as
> (
>   select root.part, root.subpart, root.quantity
>     from partlist root
>     where root.part = '01'
>   union all
>     select child.part, child.subpart, child.quantity
>       from rpl parent, partlist child
>       where parent.subpart = child.part
> )

Hmm, this doesn't look correct. What if a subpart is used by different
parts? I think the second query needs an aggregate.

But the above query certainly does solve the ancestor problem.

Does anyone have an idea how DB2 executes such a statement?

Michael
--
Michael Meskes
Michael@Fam-Meskes.De
Go SF 49ers! Go Rhein Fire!
Use Debian GNU/Linux! Use PostgreSQL!

pgsql-general by date:

Previous
From: Pawe³ Dubin
Date:
Subject: Lock rekord
Next
From: Martijn van Oosterhout
Date:
Subject: Re: copying table to a file