Re: [GENERAL] what about uniqueness of inherited primary keys

2003-12-30 Thread Chris Travers
Hi all; The real problem with using the trigger approach is as follows: Normally the unique constraint is handled by an index (most efficient way), but doing so using a trigger is more likely to lose this benefit and give you some performance problems. IIRC, the problems with inherited keys are,

Re: [GENERAL] what about uniqueness of inherited primary keys

2003-12-29 Thread Sebastian Böck
Andreas wrote: Seastian Böck wrote: for primary keys there is a simple (and at least working for me) solution as long as you can use the SERIAL type for your primary key. [...] Now the id column gets merged and you should have the desired behaviour. If you want objects.id to get referenced by othe

Re: [GENERAL] what about uniqueness of inherited primary keys

2003-12-29 Thread Andreas
Seastian Böck wrote: for primary keys there is a simple (and at least working for me) solution as long as you can use the SERIAL type for your primary key. [...] Now the id column gets merged and you should have the desired behaviour. If you want objects.id to get referenced by other tables you ha

Re: [GENERAL] what about uniqueness of inherited primary keys

2003-12-29 Thread Seastian Böck
Andreas wrote: Hello list, what about uniqueness of inherited primary keys ? eg you have : create table objects ( id int4, date_created timestamp(0), primary key (id) ); create table persons ( firstname varchar(100), lastname varchar(100) ) inherits (objects); now ... insert into object

[GENERAL] what about uniqueness of inherited primary keys

2003-12-28 Thread Andreas
Hello list, what about uniqueness of inherited primary keys ? eg you have : create table objects ( id int4, date_created timestamp(0), primary key (id) ); create table persons ( firstname varchar(100), lastname varchar(100) ) inherits (objects); now ... insert into objects (id) values