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@ (view raw, whole thread or download thread mbox)
Lists: pgsql-sql
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
At 14:27 11.9.2000 , Trewern, Ben wrote: <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>
Any help would be appreciated. <br>
<font size=2>Ben.</font> </blockquote><br>

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

In response to


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-2017 The PostgreSQL Global Development Group