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 20031229172128.GB9888@wolff.to
Whole thread Raw
In response to Re: how to set more than two attributes as primary keys in a table  (Casey Allen Shobe <cshobe@softhome.net>)
Responses Re: how to set more than two attributes as primary keys in a table
List pgsql-novice
On Mon, Dec 29, 2003 at 12:09:01 -0500,
  Casey Allen Shobe <cshobe@softhome.net> wrote:
> Bruno Wolff III (Monday 29 December 2003 12:14)
> > Note that isn't quite the same unless you add NOT NULL constraints for
> > foo and bar.
>
> Oops!  You're right, and the ID column needs a 'not null' as well.  I just
> typed that in a hurry and forgot.  Sorry.

A primary key constraint implies both unique and not null, so you don't
need to use NOT NULL on the ID column.

pgsql-novice by date:

Previous
From: Casey Allen Shobe
Date:
Subject: Re: how to set more than two attributes as primary keys in a table
Next
From: Casey Allen Shobe
Date:
Subject: Re: how to set more than two attributes as primary keys in a table