Re: [GENERAL] table has many to many relationship with itself - how

2006-06-16 Thread Bruno Wolff III
On Wed, Jun 14, 2006 at 13:51:50 -0700, [EMAIL PROTECTED] wrote: > Starting with this: > > create sequence languages_seq increment by 1; > create table languages ( > id integer primary key default nextval('languages_seq'), > language_name varchar(100) > ); > insert into languages (id, langua

Re: [GENERAL] table has many to many relationship with itself - how to implement?

2006-06-14 Thread Jim C. Nasby
On Wed, Jun 14, 2006 at 10:53:36AM +0200, Daniel McBrearty wrote: > Hi all, > > I have a table "phrases" that looks like this : > > create table phrases( > id serial , > language integer references langauges(id), > content text > ); Might want to avoid bareword 'id' as a field name... it's a gr

Re: [GENERAL] table has many to many relationship with itself - how

2006-06-14 Thread John D. Burger
[EMAIL PROTECTED] wrote: Starting with this: create sequence languages_seq increment by 1; create table languages ( id integer primary key default nextval('languages_seq'), language_name varchar(100) ); (I like specifying my own sequence names, instead of using "serial", plus using a d

Re: [GENERAL] table has many to many relationship with itself - how

2006-06-14 Thread Daniel McBrearty
thanks Susan for your idea. I thought that was it for a moment, then I saw a problem (I think) - it works, but gets quite inefficient. when you have 2 phrases which are a translation, that is just one entry when you have 3, that is 3 4 => 6 and so on. In practice we might have 15, 20 language

Re: [GENERAL] table has many to many relationship with itself - how

2006-06-14 Thread SCassidy
Starting with this: create sequence languages_seq increment by 1; create table languages ( id integer primary key default nextval('languages_seq'), language_name varchar(100) ); insert into languages (id, language_name) values (1, 'English'); insert into languages (id, language_name) values (2