Re: Doing sth. like oracles "connect by"

From: Joe Conway <mail(at)joeconway(dot)com>
To: Harald Armin Massa <pgsql(dot)16(dot)ghum(at)spamgourmet(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Doing sth. like oracles "connect by"
Date: 2002-11-16 20:40:22
Message-ID: 3DD6AD36.8000509@joeconway.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Harald Armin Massa wrote:
> What is the most effective and elegant way to substitute the connect by
> clause from oracle in postgresql?
>
> Explanation of connect by:
>
> with "connect by" in oracle it is possible to formulate queries returning
> whole hierarchies.
>

If you can try 7.3 (finishing beta, soon to be released), see
contrib/tablefunc for a function called connectby(). There is also a different
approach to the problem in contrib/ltree.

If you cannot use 7.3, there have been past discussions wrt implementing tree
structure -- search the mail archives. I *think* contrib/ltree might be
available backported to 7.2 -- yeah, from the README:

"(version for 7.2 version is available from
http://www.sai.msu.su/~megera/postgres/gist/ltree/ltree-7.2.tar.gz)"

HTH,

Joe

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Frank Miles 2002-11-16 21:29:25 Re: DECLARE CURSOR
Previous Message John Burski 2002-11-16 20:21:47 Re: Parse error