How to store directory like structures?

Поиск
Список
Период
Сортировка
От Axel Straschil
Тема How to store directory like structures?
Дата
Msg-id slrnd4vghu.tp.axel@m2.sine
обсуждение исходный текст
Ответы Re: How to store directory like structures?  (Oleg Bartunov <oleg@sai.msu.su>)
Re: How to store directory like structures?  (PFC <lists@boutiquenumerique.com>)
Список pgsql-sql
Hello!

I want to store some structure like:

CREATE TABLE node
(nodeid    SERIAL PRIMARY KEY,parent    INT REFERENCES node(nodeid)        ON UPDATE CASCADE ON DELETE CASCADE,label
TEXT,UNIQUE(parent, label),...data ...
 
);

The label is used to map a node to a directory like strukture, so i can
have a function directory_for(nodeid) which gives me
/root_label/parent_label/parent_label/my_label (root labels have NULL as parent)

The problem is the ammount of queries when i've got deep nodes, and I
often have to query if a node is "in path" of another node.

Is there a good solution to build directory-tree like datastruktures?
I found, http://www.sai.msu.su/~megera/postgres/gist/ltree/ which seems
to do what i want, but I've no idea (and probalbly no chance) to get
that running on my system ;-(

Thanks,
AXEL.



В списке pgsql-sql по дате отправления:

Предыдущее
От: PFC
Дата:
Сообщение: Re: Query history file
Следующее
От: "Sean Davis"
Дата:
Сообщение: Re: a very big table