Received: from as104.tel.hr (as104.tel.hr [205.219.255.36]) by hub.org (8.10.1/8.10.1) with ESMTP id e8BHdX724342 for ; Mon, 11 Sep 2000 13:39:33 -0400 (EDT) Received: from proxyplus.universe (ao1-m181.tel.hr [195.29.32.181]) by as104.tel.hr (0.0.0/0.0.0) with ESMTP id TAA217125; Mon, 11 Sep 2000 19:39:32 +0200 (MEST) Received: from 192.168.0.1 by Proxy+; Mon, 11 Sep 2000 16:40:51 GMT Message-Id: <4.1.20000911182824.018d5078@192.168.0.7> X-Sender: zeljko@192.168.0.7 X-Mailer: QUALCOMM Windows Eudora Pro Version 4.1 Date: Mon, 11 Sep 2000 18:30:55 +0200 To: "Trewern, Ben" , "'pgsql-sql@postgresql.org'" From: Zeljko Trogrlic Subject: Re: Tree structure In-Reply-To: <996802F75C3CD411B424001083FA445B0594B0@CET_PONXX_FP001> Mime-Version: 1.0 Content-Type: text/html; charset="us-ascii" X-Archive-Number: 200009/69 Normally it's done with self-relation. You need a table with "ID" and "PARENT_ID". 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.

At 14:27 11.9.2000 , Trewern, Ben wrote:

Anybody know how to make a tree structure using related tables using Postgres.  Something like a directory structure is what I'm aiming for.  I'm sure there is an easy way but I'm having probs.

Any help would be appreciated.

Ben.