Skip site navigation (1) Skip section navigation (2)

Re: Tree structure

From: Zeljko Trogrlic <zeljko(at)technologist(dot)com>
To: "Trewern, Ben" <Ben(dot)Trewern(at)mowlem(dot)com>, "'pgsql-sql(at)postgresql(dot)org'" <pgsql-sql(at)postgresql(dot)org>
Subject: Re: Tree structure
Date: 2000-09-11 16:30:55
Message-ID: 4.1.20000911182824.018d5078@192.168.0.7 (view raw or flat)
Thread:
Lists: pgsql-sql
<html>
Normally it's done with self-relation. You need a table with
&quot;ID&quot; and &quot;PARENT_ID&quot;. PARENT_ID will contain null for
root level and other row's ID for children. One warning: going through
such tree could be slow. I don't know is there anything PostgreSQL
specific that might help. I know that Oracle have a special tree
command.<br>
<br>
At 14:27 11.9.2000 , Trewern, Ben wrote: <br>
<br>
<font size=2><blockquote type=cite cite>Anybody know how to make a tree
structure using related tables using Postgres.&nbsp; Something like a
directory structure is what I'm aiming for.&nbsp; I'm sure there is an
easy way but I'm having probs.<br>
</font><br>
Any help would be appreciated. <br>
<br>
<font size=2>Ben.</font> </blockquote><br>
</html>




Attachment: unknown_filename
Description: text/html (769 bytes)

In response to

Responses

pgsql-sql by date

Next:From: G. Anthony ReinaDate: 2000-09-11 23:37:43
Subject: How can I select all of the tables with field name 'area'?
Previous:From: Albert REINERDate: 2000-09-11 16:25:58
Subject: Re: Tree structure

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group