From: | David A Dickson <davidd(at)saraswati(dot)wcg(dot)mcgill(dot)ca> |
---|---|
To: | Angela Luyf <a(dot)c(dot)luyf(at)amc(dot)uva(dot)nl> |
Cc: | <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: two primairy key in one table ? |
Date: | 2002-07-05 15:19:33 |
Message-ID: | Pine.LNX.4.33.0207051117150.9778-100000@blues.wcg.mcgill.ca |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
A tabe defined as
CREATE TABLE foobar (
foo int,
bar int,
PRIMARY KEY (foo, bar) );
will allow many elements of type foo to be related to many elements of
type bar and vice versa. Each combiniation of foo and bar will be forced
unique.
On Thu, 4 Jul 2002, Angela Luyf wrote:
> Hello,
> I have a database model where a many to many relation is used, so i need
> to create a table with two primary key. Don't know how to solve this in
> postgress, can't find it in the tutorials, so can anybody help me with
> this ?
>
> A. Luyf
--
David A Dickson
david(dot)dickson(at)mail(dot)mcgill(dot)ca
From | Date | Subject | |
---|---|---|---|
Next Message | Darren Ferguson | 2002-07-05 15:28:09 | Re: two primairy key in one table ? |
Previous Message | Thomas Lockhart | 2002-07-05 15:17:25 | Re: explicit cast error |