Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 1AFA66332FD for ; Wed, 20 Jan 2010 12:43:55 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 60278-08 for ; Wed, 20 Jan 2010 16:43:44 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by mail.postgresql.org (Postfix) with SMTP id 09BDC633291 for ; Wed, 20 Jan 2010 12:43:43 -0400 (AST) Received: (qmail invoked by alias); 20 Jan 2010 16:43:38 -0000 Received: from unknown (EHLO [192.168.1.113]) [88.130.196.99] by mail.gmx.net (mp068) with SMTP; 20 Jan 2010 17:43:38 +0100 X-Authenticated: #14269776 X-Provags-ID: V01U2FsdGVkX1+9XRM3YZ29ucA6JlphfOeMri88vsUXi1zVffiO6y ZPGmtWw6fuZoUv Message-ID: <4B5732A0.1090006@gmx.net> Date: Wed, 20 Jan 2010 17:43:12 +0100 From: Andreas User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Gurjeet Singh CC: pgsql-sql@postgresql.org Subject: Re: How to cascade information like the user roles ? References: <4B54FDF3.4070601@gmx.net> <92869e661001190627i4d42e368nbb0e96bf5c54ca76@mail.gmail.com> <4B55E22F.80409@gmx.net> <65937bea1001192145u380846f3u30cc10d9d1784690@mail.gmail.com> <65937bea1001192223o2a443c3dw9148352fc2bb76d4@mail.gmail.com> In-Reply-To: <65937bea1001192223o2a443c3dw9148352fc2bb76d4@mail.gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Y-GMX-Trusted: 0 X-FuHaFi: 0.73999999999999999 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.599 tagged_above=-10 required=5 tests=BAYES_00=-2.599 X-Spam-Level: X-Archive-Number: 201001/39 X-Sequence-Number: 33575 Thanks a whole lot and some :) It's great that you actually did a working script. I find it tremendosly easier to learn with a working example than with some links to other documentation which makes or does not make sense. I've got a 8.4 server so both ways work nicely. Is there a way to prevent inheritance loops instead of denying parent_id > child_id ? Parallel inheritance has to work, though. 1 <-- 2 and 3 <-- 4 I found the function running into a stack overflow when I intetionally created a loop to check what'll happen. At least this is a predefined limit in max_stack_depth. The with recursive thingy just kept going which generally tends to be worse, I guess. Regards :)