Re: recursive function

From: "Jim C(dot) Nasby" <jnasby(at)pervasive(dot)com>
To: Klein Bal?zs <Balazs(dot)Klein(at)axelero(dot)hu>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: recursive function
Date: 2005-12-20 18:25:55
Message-ID: 20051220182555.GW28771@pervasive.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, Dec 20, 2005 at 06:58:41PM +0100, Klein Bal?zs wrote:
> In practice however this doesn?t seem to work as the function never returns.
>
> Should this work in theory? Is this the recommended approach?

I can' think of any reason why it wouldn't work; have you tried adding
RAISE statements to see what's actually happening?

Also, you should look at contrib/ltree; it might be a better way to do
what you're trying to do. Celko's book SQL For Smarties also has some
different ways to store hierarchies; unfortunately it's not handy or I
could give you some google search terms, but the book's worthy buying
anyway. Apparently he's also got a book that's dedicated to hierarchies
and graphs, but I don't know how good it is.
--
Jim C. Nasby, Sr. Engineering Consultant jnasby(at)pervasive(dot)com
Pervasive Software http://pervasive.com work: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf cell: 512-569-9461

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Hunter's Lists 2005-12-20 19:30:34 Syntax Error Inserting From STDIN?
Previous Message Klein Balázs 2005-12-20 17:58:41 recursive function