Re: how to set more than two attributes as primary keys in a table - Mailing list pgsql-novice

From Bruno Wolff III
Subject Re: how to set more than two attributes as primary keys in a table
Date
Msg-id 20031229042427.GC4924@wolff.to
Whole thread Raw
In response to how to set more than two attributes as primary keys in a table  (Peggy Go <shatz_go@yahoo.com>)
Responses Re: how to set more than two attributes as primary keys in a table
List pgsql-novice
On Sun, Dec 28, 2003 at 20:21:32 -0800,
  Peggy Go <shatz_go@yahoo.com> wrote:
> 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,
  Num_Players    smallint,
  Player_Num    smallint,
  primary key (Region_Num, Num_Players)
);

pgsql-novice by date:

Previous
From: Peggy Go
Date:
Subject: how to set more than two attributes as primary keys in a table
Next
From: Michael Fuhr
Date:
Subject: Re: how to set more than two attributes as primary keys in a table