Skip site navigation (1) Skip section navigation (2)

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search archives
  Advanced Search

Re: [Fwd: SQL3 recursive unions]


  • From: Michael Meskes <meskes(at)postgresql(dot)org>
  • To: Ron Peterson <rpeterson(at)yellowbank(dot)com>
  • Cc: pgsql-general(at)postgresql(dot)org
  • Subject: Re: [Fwd: SQL3 recursive unions]
  • Date: Sat, 17 Jun 2000 14:17:23 +0200
  • Message-id: <20000617141723.A16029@fam-meskes.de> <text/plain>

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(at)Fam-Meskes(dot)De
Go SF 49ers! Go Rhein Fire!
Use Debian GNU/Linux! Use PostgreSQL!



Home | Main Index | Thread Index

Privacy Policy | About PostgreSQL
Copyright © 1996 – 2012 PostgreSQL Global Development Group