Re: Joe Celko Function

From: Fran Fabrizio <ffabrizio(at)mmrd(dot)com>
To: Ben-Nes Michael <miki(at)canaan(dot)co(dot)il>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Joe Celko Function
Date: 2002-05-01 13:36:22
Message-ID: 3CCFEF56.5000606@mmrd.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


To drop branches, I typically loop through this function. But it would be easy to extend this case to drop an entire branch at
once. You just need to know what the offset is. If you are dropping a whole brach, it's actually an easier case, because you
don't have to worry about shifting lower nodes on the branch (nodes that appear between the lft and rgt of the node you dropped).
So if the lft is 50 and the rgt is 60, everyone else's numbers would just shift down 11. (The former lft 61 should become lft
50, etc...).

-Fran

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Andrew Sullivan 2002-05-01 14:19:58 Re: Failed compile on Sun
Previous Message Ben-Nes Michael 2002-05-01 13:25:23 Re: Joe Celko Function