Re: How to represent a tree-structure in a relational database

From: Ron Peterson <ron(dot)peterson(at)yellowbank(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: How to represent a tree-structure in a relational database
Date: 2000-12-28 14:45:32
Message-ID: 3A4B520C.98F98689@yellowbank.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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-

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Ron Peterson 2000-12-28 15:12:56 Re: How to represent a tree-structure in a relational database
Previous Message Ron Peterson 2000-12-28 14:36:57 Re: Compiling "C" Functions