Re: connect by [prior]

From: Joe Conway <mail(at)joeconway(dot)com>
To: Nabil Sayegh <postgresql(at)e-trolley(dot)de>
Cc: gerard(dot)tourres(at)free(dot)fr, Forum PostgreSQL <pgsql-novice(at)postgresql(dot)org>
Subject: Re: connect by [prior]
Date: 2003-05-21 15:20:47
Message-ID: 3ECB994F.5060107@joeconway.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Nabil Sayegh wrote:
> Am Mit, 2003-05-21 um 10.42 schrieb Gerard TOURRES:
>>I can't find an equivalent for select...connect by (sort data in a
>>tree, beginning at a defined point towards 'son' or 'father').
>>
>>Running Psql 7.2.1 on Debian woody
>
> This is called "WITH RECURSIVE" in SQL '99 and not yet implemented in
> 7.3.1
> But it is possible to write a "stored procedure" (function) that does
> the same thing.

Gerard's question was WRT 7.2.1, not 7.3.1. I'm afraid on 7.2.x you are
pretty much out of luck :-(

If you do upgrade to 7.3.x (7.3.3 ought to be out by next week), then in
contrib/tablefunc there is a function called connectby() that should do
what you're looking for.

There was some discussion about someone implementing SQL '99 "WITH
RECURSIVE" for 7.4, but it doesn't look like that is going to happen --
maybe for 7.5 it will be there.

HTH,

Joe

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Joe Conway 2003-05-21 15:32:57 Re: parse error when executing a simple plpgsql function
Previous Message Tom Lane 2003-05-21 14:43:52 Re: postmaster didnt start after power failure.