Re: Is a primary key made of a couple columns so much better than a unique() constraint ?

Поиск
Список
Период
Сортировка
От David Pradier
Тема Re: Is a primary key made of a couple columns so much better than a unique() constraint ?
Дата
Msg-id 20051010153026.GC12162@clarisys.fr
обсуждение исходный текст
Ответ на Re: Is a primary key made of a couple columns so much better than a unique() constraint ?  (Tom Lane <tgl@sss.pgh.pa.us>)
Список 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 по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Is a primary key made of a couple columns so much better than a unique() constraint ?
Следующее
От: Tom Lane
Дата:
Сообщение: Re: strange error