Re: [GENERAL] Nodes and trees...

2010-08-03 Thread David Fetter
On Tue, Aug 03, 2010 at 02:01:58PM +0200, Jason Schauberger wrote: > Dear fellow Postgres users, :-) > > please consider this table: > > CREATE TABLE nodes ( > > id int PRIMARY KEY, > > parent int REFERENCES nodes(id) > > ); Generally, you'll want to separate the nodes table

Re: [GENERAL] Nodes and trees...

2010-08-03 Thread Igor Neyman
> -Original Message- > From: Jason Schauberger [mailto:crossroads0...@googlemail.com] > Sent: Tuesday, August 03, 2010 8:02 AM > To: pgsql-general@postgresql.org > Subject: Nodes and trees... > > Dear fellow Postgres users, :-) > > please consider this table: > > CREATE TABLE nodes (

Re: [GENERAL] Nodes and trees...

2010-08-03 Thread Merlin Moncure
On Tue, Aug 3, 2010 at 8:01 AM, Jason Schauberger wrote: > Dear fellow Postgres users, :-) > > please consider this table: > > CREATE TABLE nodes ( > > id      int     PRIMARY KEY, > > parent     int     REFERENCES nodes(id) > > ); > > In this table, each node *can* have a parent node. You can pic

[GENERAL] Nodes and trees...

2010-08-03 Thread Jason Schauberger
Dear fellow Postgres users, :-) please consider this table: CREATE TABLE nodes ( id int PRIMARY KEY, parent int REFERENCES nodes(id) ); In this table, each node *can* have a parent node. You can picture the whole set of rows of this table as one or more trees with nodes and t