Re: Is a primary key made of a couple columns so much better than a unique() constraint ? - Mailing list pgsql-general

From David Pradier
Subject Re: Is a primary key made of a couple columns so much better than a unique() constraint ?
Date
Msg-id 20051010153026.GC12162@clarisys.fr
Whole thread Raw
In response to Re: Is a primary key made of a couple columns so much better than a unique() constraint ?  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
> Just for the sake of completeness, there are exactly two differences:
> * PRIMARY KEY implies NOT NULL on the key columns; UNIQUE doesn't.
> * PRIMARY KEY creates a default target for foreign key references,
>   ie, if you've declared a primary key then you can later just say
>   "REFERENCES mytab" instead of spelling out "REFERENCES mytab(keycol)".
> So "UNIQUE + NOT NULL" is pretty dang close to the same as "PRIMARY
> KEY", but not quite.
>             regards, tom lane

Thanks too, Tom :-)

Best regards,
David

--
David Pradier -- Directeur Technique de Clarisys Informatique -- Chef de projet logiciels libres / open-source

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Is a primary key made of a couple columns so much better than a unique() constraint ?
Next
From: Tom Lane
Date:
Subject: Re: strange error