how to set more than two attributes as primary keys in a table

From: Peggy Go <shatz_go(at)yahoo(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: how to set more than two attributes as primary keys in a table
Date: 2003-12-29 04:21:32
Message-ID: 20031229042132.66509.qmail@web41313.mail.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Hi!...

Normally, there is only one attribute for the primary
key but in my table, my primary key is composed of two
attributes. How do I state this in SQL? What if
Region_num and Num_Players, combined, should form a
primary key?

CREATE TABLE REGION (
Region_Num smallint primary key,
Num_Players smallint,
Player_Num smallint
);

Thanks!

__________________________________
Do you Yahoo!?
New Yahoo! Photos - easier uploading and sharing.
http://photos.yahoo.com/

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Bruno Wolff III 2003-12-29 04:24:27 Re: how to set more than two attributes as primary keys in a table
Previous Message Richard LASJUNIES 2003-12-28 20:29:53 Re: multiline PL/Python function fails in *.sql