> > Besides, I couldn't see much use in creating it as a primary 
> > key.  How 
> > would I ever reference it from another table?

If you're questioning how to use a multi-field primary key, it's easy...


create table p (id1 int not null, id2 int not null, primary key(id1,
id2));

create table c (id1 int, id2 int, foreign key (id1, id2) references p);

insert into p values (1,2);
insert into c values (1,1);
insert into c values (1,0);

ERROR:  <unnamed> referential integrity violation - key referenced from c
not found in p

-- 
Joel Burton   <[EMAIL PROTECTED]>
Director of Information Systems, Support Center of Washington


---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Reply via email to