From: Rajesh Kumar Mallah. <mallah@trade-india.com>
To: Achilleus Mantzios <achill@matrix.gatewaynet.com>
To: Gregory Brauer <greg@wildbrain.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: Trees in SQL
Date: Mon, 27 May 2002 18:27:30 +0530
Message-ID: <200205271827.30013.mallah@trade-india.com> (raw)
In-Reply-To: <Pine.LNX.4.33.0205271438080.1584-100000@matrix.gatewaynet.com>
References: <Pine.LNX.4.33.0205271438080.1584-100000@matrix.gatewaynet.com>
Hey Please post the translation back here !!
;-)
lot many others like would require it
despo.
regds
mallah.
On Monday 27 May 2002 05:30 pm, Achilleus Mantzios wrote:
> On Fri, 24 May 2002, Gregory Brauer wrote:
>
> I have exactly the same situation.
>
> Some work (argued to have better performance than Celko's implementation)
> has been done by Miguel Sofer. (see http://www.utdt.edu/~mig/trees.tar.gz)
>
> One fast solution would be using pgsql arrays and the contrib/array
> package.
>
> However Oleg's and Theodor's contrib/tree solution looks the most
> attractive.
>
> I will ask my wife today to do a translation of the doc,
> (hoping russian and yugoslavian are alike :)
>
> > I hope this isn't an overly broad topic that ends up diverging into graph
> > theory, but I have a tree structure of identical items (analogous to a
> > filesystem directory tree) that I need to store in Postgres. The
> > "obvious" design is to give the table that will represent these objects
> > a field identifying its "parent" that is a relation to the same table.
> > However, this seems to make many common SQL queries rather difficult.
> >
> > What sort of strategies are best for storing tree structures in a
> > relational database, and how would one structure SQL queries to find,
> > say, "all of the children anywhere under this node", or to represent
> > the condition "if this node is a child at any depth under this other
> > node"? Are there good strategies for preventing cycles?
> >
> > I'd appreciate any insights anyone can give.
> >
> > Thanks.
> >
> > Greg Brauer
> > greg@wildbrain.com
> >
> >
> > ---------------------------(end of broadcast)---------------------------
> > TIP 5: Have you checked our extensive FAQ?
> >
> > http://www.postgresql.org/users-lounge/docs/faq.html
--
Rajesh Kumar Mallah,
Project Manager (Development)
Infocom Network Limited, New Delhi
phone: +91(11)6152172 (221) (L) ,9811255597 (M)
Visit http://www.trade-india.com ,
India's Leading B2B eMarketplace.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: mallah@trade-india.com, achill@matrix.gatewaynet.com, greg@wildbrain.com
Subject: Re: Trees in SQL
In-Reply-To: <200205271827.30013.mallah@trade-india.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox