Re: Adjacency List or Nested Sets to model file system hierarchy?

From: Alban Hertroys <alban(at)magproductions(dot)nl>
To: Bill Moseley <moseley(at)hank(dot)org>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Adjacency List or Nested Sets to model file system hierarchy?
Date: 2007-02-13 09:05:45
Message-ID: 45D17F69.4000202@magproductions.nl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)magproductions(dot)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 //

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Shane Ambler 2007-02-13 09:13:01 Re: Testing embedded SQL in C
Previous Message Ashish Karalkar 2007-02-13 08:55:24 How to append tables in a view