Re: [SQL] multi-table unique index

2003-06-23 Thread Richard Huxton
On Monday 23 Jun 2003 2:58 pm, Markus Bertheau wrote: > -- Suppose I have several types of foos > > create table foo_types ( > foo_type_id serial primary key, > foo_name text not null > ); > > -- And the foos itself: > > create table foo ( > foo_id serial primary key, > foo_type_id

Re: [SQL] multi-table unique index

2003-06-23 Thread Markus Bertheau
В Пнд, 23.06.2003, в 20:34, Michael A Nachbaur пишет: > On Monday 23 June 2003 11:16 am, Markus Bertheau wrote: > > В Пнд, 23.06.2003, в 19:32, Michael A Nachbaur пишет: > > > Instead of using the "serial" datatype, you can set it to "int4 PRIMARY > > > KEY DEFAULT nextval(foo_type_id_seq)" and you

Re: [SQL] multi-table unique index

2003-06-23 Thread Michael A Nachbaur
On Monday 23 June 2003 11:16 am, Markus Bertheau wrote: > В Пнд, 23.06.2003, в 19:32, Michael A Nachbaur пишет: > > Instead of using the "serial" datatype, you can set it to "int4 PRIMARY > > KEY DEFAULT nextval(foo_type_id_seq)" and you can manually create the > > sequence "foo_type_id_seq". > > >

Re: [SQL] multi-table unique index

2003-06-23 Thread Markus Bertheau
В Пнд, 23.06.2003, в 19:32, Michael A Nachbaur пишет: > Instead of using the "serial" datatype, you can set it to "int4 PRIMARY KEY > DEFAULT nextval(foo_type_id_seq)" and you can manually create the sequence > "foo_type_id_seq". > > This way all the tables share the same sequence. Yeah, but I

Re: [SQL] multi-table unique index

2003-06-23 Thread Michael A Nachbaur
Instead of using the "serial" datatype, you can set it to "int4 PRIMARY KEY DEFAULT nextval(foo_type_id_seq)" and you can manually create the sequence "foo_type_id_seq". This way all the tables share the same sequence. On Monday 23 June 2003 06:58 am, Markus Bertheau wrote: > -- Suppose I have