Re: tree-like structures in pgsql - Mailing list pgsql-novice

From Richard Broersma Jr
Subject Re: tree-like structures in pgsql
Date
Msg-id 556291.89699.qm@web31802.mail.mud.yahoo.com
Whole thread Raw
In response to tree-like structures in pgsql  ("Angelica Garcia" <doitviolet@hotmail.com>)
List pgsql-novice
--- Angelica Garcia <doitviolet@hotmail.com> wrote:

> Hello *,
>
> I would like to save a tree-like structure in a pgsql table. Can anyone give
> me some suggestions about how can I achieve this task?
>
> I will also appreciate any information that points to how to create new data
> types in pgsql, if that is possible.

My understanding is that there are three popular ways to store trees in a table:
1) adjacency list model
http://www.sqlsummit.com/AdjacencyList.htm
2) path enumeration model
http://www.onlamp.com/pub/a/onlamp/2004/08/05/hierarchical_sql.html
3) nested set model
http://www.dbmsmag.com/9603d06.html

Each has strengths and weaknesses.  And each has a different method of querying hierarchical data.
Regards,
Richard Broersma Jr.

pgsql-novice by date:

Previous
From: "Angelica Garcia"
Date:
Subject: tree-like structures in pgsql
Next
From: Chirag Patel
Date:
Subject: clustering and denormalizing with PostgreSQL?