Re: two primairy key in one table ?

From: Josh Jore <josh(at)greentechnologist(dot)org>
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:13:49
Message-ID: Pine.BSO.4.44.0207051012440.812-100000@kitten.greentechnologist.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Oh sure, that's easy. Make the primary key be a table constraint instead
of just a single column.

CREATE TABLE foo (
a int,
b int,
PRIMARY KEY (a,b)
);

Joshua b. Jore ; http://www.greentechnologist.org

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
>
>
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo(at)postgresql(dot)org so that your
> message can get through to the mailing list cleanly
>
>
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Thomas Lockhart 2002-07-05 15:17:25 Re: explicit cast error
Previous Message Shaun Thomas 2002-07-05 15:11:28 Re: Postgre vs MySQL