Re: tree-like structures in pgsql

From: Richard Broersma Jr <rabroersma(at)yahoo(dot)com>
To: Angelica Garcia <doitviolet(at)hotmail(dot)com>, pgsql-novice(at)postgresql(dot)org
Subject: Re: tree-like structures in pgsql
Date: 2007-08-06 20:10:45
Message-ID: 556291.89699.qm@web31802.mail.mud.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice


--- Angelica Garcia <doitviolet(at)hotmail(dot)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.

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Chirag Patel 2007-08-06 21:05:10 clustering and denormalizing with PostgreSQL?
Previous Message Angelica Garcia 2007-08-06 19:55:02 tree-like structures in pgsql