Re: two primairy key in one table ? - Mailing list pgsql-general

From David A Dickson
Subject Re: two primairy key in one table ?
Date
Msg-id Pine.LNX.4.33.0207051117150.9778-100000@blues.wcg.mcgill.ca
Whole thread Raw
In response to two primairy key in one table ?  (Angela Luyf <a.c.luyf@amc.uva.nl>)
List 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.dickson@mail.mcgill.ca




pgsql-general by date:

Previous
From: Thomas Lockhart
Date:
Subject: Re: explicit cast error
Next
From: Shaun Thomas
Date:
Subject: Re: Postgre vs MySQL