pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Ron Peterson <ron.peterson@yellowbank.com>
To: pgsql-sql@postgresql.org
Subject: Re: How to represent a tree-structure in a relational database
Date: Thu, 28 Dec 2000 09:45:32 -0500
Message-ID: <3A4B520C.98F98689@yellowbank.com> (raw)
References: <NEBBJLPJHKIDLJDGCMKAKEIDCBAA.stu@slammedia.com>
	<3A4B4D8C.9E542934@yellowbank.com>

Ron Peterson wrote:
> 
> CREATE TABLE category_edge (
>         parent  INTEGER
>                 NOT NULL
>                 REFERENCES category_node(id),
> 
>         child   INTEGER
>                 NOT NULL
>                 REFERENCES category_node(id)
> );

Just for the sake of anal-retentive completeness, I'd like to point out
that you'd probably want an id field in this table also.  Plus what the
heck else am I going to do on Christmas break?  ;)

On a completely unrelated topic: getting the PostgreSQL discussions
lists on a news server is great!!!  I was overwhelmed with mail that I
usually don't have time to deal with.  Now when I have a chance, I just
go see what's up on the news server.  Excellent and thanks!

-Ron-



view thread (27+ messages)  latest in thread

Message-ID: <3A4B520C.98F98689@yellowbank.com>
Permalink:  ../3A4B520C.98F98689@yellowbank.com/
Also on:    postgresql.org/message-id/3A4B520C.98F98689@yellowbank.com

 · 

reply

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: ron.peterson@yellowbank.com
  Subject: Re: How to represent a tree-structure in a relational database
  In-Reply-To: <3A4B520C.98F98689@yellowbank.com>
  References: <NEBBJLPJHKIDLJDGCMKAKEIDCBAA.stu@slammedia.com> <3A4B4D8C.9E542934@yellowbank.com> <3A4B520C.98F98689@yellowbank.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