X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 528365354D for ; Sat, 16 Apr 2005 11:28:33 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 10366-07 for ; Sat, 16 Apr 2005 14:28:23 +0000 (GMT) Received: from rproxy.gmail.com (rproxy.gmail.com [64.233.170.202]) by svr1.postgresql.org (Postfix) with ESMTP id 2581A536F8 for ; Sat, 16 Apr 2005 11:28:22 -0300 (ADT) Received: by rproxy.gmail.com with SMTP id j1so750743rnf for ; Sat, 16 Apr 2005 07:28:27 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=ItKVrqJ9e5u+Ed+Ns31CmDyJUlZ/8YEqjEIoE49Bb94tn7KwO2ZUEt8oHWFj5+8jImCLPiXcRU0EaEzvSrpoF3SgAPECw367gBjARoJx5XciGNyjnFGQhXc+yLKeEWzkqi9BdX0ioBwNum+3PSs+a5owI/1dLD5S3CyFYfSYAxc= Received: by 10.38.1.71 with SMTP id 71mr708395rna; Sat, 16 Apr 2005 07:28:27 -0700 (PDT) Received: by 10.38.209.59 with HTTP; Sat, 16 Apr 2005 07:28:27 -0700 (PDT) Message-ID: Date: Sat, 16 Apr 2005 18:28:27 +0400 From: "A. Kulikov" Reply-To: "A. Kulikov" To: pgsql-sql@postgresql.org Subject: Re: Nested Sets In-Reply-To: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.304 tagged_above=0 required=5 tests=AWL, DNS_FROM_RFC_ABUSE, RCVD_BY_IP X-Spam-Level: X-Archive-Number: 200504/233 X-Sequence-Number: 21126 Seen this before. The solution is rather lame, as most of the logic is shifted out to the code, whereas it could have been implemented in the database directly. I have managed to get a move_tree algorythm working rather fast and glitch free by now, yet I am wondering if there are other directions to follow. What I can see as actual are: * deleting trees * swapping nodes places on one level (including the subtrees) btw, do stored procedures (user functions in other words) have to implement table locking or be carried out inside a transaction such that the nested set indexes remain intact? regards, alex 2005/4/16, Troels Arvin : > On Sat, 16 Apr 2005 16:31:43 +0400, A. Kulikov wrote: >=20 > > Has anyone implemented a pretty Nested Sets solution in > > PostgreSQL? >=20 > Maybe this is useful? : > http://threebit.net/tutorials/nestedset/tutorial1.html >=20 > -- > Greetings from Troels Arvin, Copenhagen, Denmark >=20 > ---------------------------(end of broadcast)--------------------------- > TIP 5: Have you checked our extensive FAQ? >=20 > http://www.postgresql.org/docs/faq >=20 --=20 The mind is essential -- http://essentialmind.com/