Received: from rakete.joerdens.de (rakete.joerdens.de [62.104.116.200]) by mail.postgresql.org (8.11.1/8.11.1) with ESMTP id eBJDHv679411 for ; Tue, 19 Dec 2000 08:17:57 -0500 (EST) (envelope-from frank@joerdens.de) Received: from limedes.archi-me-des.de (pD900256D.dip.t-dialin.net [217.0.37.109]) by rakete.joerdens.de (8.9.3/8.9.3) with ESMTP id OAA16912; Tue, 19 Dec 2000 14:37:43 +0100 Received: from joerdens.de (tricky.archi-me-des.de [192.168.100.1]) by limedes.archi-me-des.de (8.9.3/8.9.3) with ESMTP id OAA00359; Tue, 19 Dec 2000 14:02:26 +0100 Message-ID: <3A3F6006.ECDE92AE@joerdens.de> Date: Tue, 19 Dec 2000 14:17:58 +0100 From: Frank Joerdens X-Mailer: Mozilla 4.72 [en] (WinNT; I) X-Accept-Language: en MIME-Version: 1.0 To: Tulassay Zsolt CC: pgsql-sql@postgresql.org Subject: Re: Tree structure table normalization problem (do I need atrigger?) References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Archive-Number: 200012/212 X-Sequence-Number: 546 Tulassay Zsolt wrote: [ . . . ] > The SQL stuff of that nested set structure is fairly easy, I wrote some > quick'n'dirty plpgsql functions that will do inserts, updates, deletes > from the tree, display level number etc. What scared me about it in particular was one scenario where you try to delete a subtree. This would normally leave a gap, since the structure is based on the worm's ability to get from one node to the next with an increment of just 1. Once you had a subtree deleted, you'd either would have to have the worm leap-frog (a leaping frog-worm?!! :)) the gap or update an entire half of the tree to close it . . . then my brain started to hurt and I gave up. > I can send it to you if you like (please allow a few days since I > have several exams at the university this week). Sure, I'd like to have a look at it! Thanks, Frank