Re: Adjacency List or Nested Sets to model file system hierarchy? - Mailing list pgsql-general

From Alban Hertroys
Subject Re: Adjacency List or Nested Sets to model file system hierarchy?
Date
Msg-id 45D17F69.4000202@magproductions.nl
Whole thread Raw
In response to Re: Adjacency List or Nested Sets to model file system hierarchy?  (Bill Moseley <moseley@hank.org>)
List pgsql-general
Bill Moseley wrote:
> On Mon, Feb 12, 2007 at 05:36:37PM +0000, Ian Harding wrote:
>> You don't mention the ltree contrib module, have you looked at it?  It
>> can easily meet your requirements without having to reinvent anything.
>> It may be what you're referring to as Nested Sets, I don't know.  I
>> use it and like it a lot.
>
> Yes, I have seen it.  I just thought it seemed like a very large
> "hammer" to use form my task -- quite a few more query methods than I
> need .  But, perhaps I should look at it again and get a better
> understanding of what it can do.

What it can do is add indexed paths to your records ;)

You will still have to check consistency on updates to paths (fe. if the
root node changes name, all nodes need updating) though, but that's true
for any method including the entire path. And on delete (remove child
nodes as well) and insert (check parents existence), of course.

--
Alban Hertroys
alban@magproductions.nl

magproductions b.v.

T: ++31(0)534346874
F: ++31(0)534346876
M:
I: www.magproductions.nl
A: Postbus 416
   7500 AK Enschede

// Integrate Your World //

pgsql-general by date:

Previous
From: "Ashish Karalkar"
Date:
Subject: How to append tables in a view
Next
From: Shane Ambler
Date:
Subject: Re: Testing embedded SQL in C