Re: PRIMARY KEYS

Поиск
Список
Период
Сортировка
От Erik Price
Тема Re: PRIMARY KEYS
Дата
Msg-id 3ECCBC96.3070405@ptc.com
обсуждение исходный текст
Ответ на Re: PRIMARY KEYS  (Martijn van Oosterhout <kleptog@svana.org>)
Список pgsql-general

Martijn van Oosterhout wrote:
> On Wed, May 21, 2003 at 12:02:01PM -0400, Vivek Khera wrote:
>
>>>>>>>"MvO" == Martijn van Oosterhout <kleptog@svana.org> writes:
>>
>>MvO> Number or Drivers Licence number as primary key is forbidden. If
>>MvO> you're permitted to have the information you're allowed to store
>>MvO> it but you sure as hell can't index your filing cabinets on it or
>>MvO> make it a primary key.
>>
>>What exactly is the difference between
>>
>>UNIQUE INDEX on a NOT NULL column of driver license numbers with no
>>other primary key on that table
>>
>>and
>>
>>PRIMARY KEY on that same column?
>>
>>The only thing that changed was the name.
>
>
> There's no *technical* difference, but a very large semantic difference.
> Whatever you use as your primary will become prolific.

One technical difference is that if you declare a column as a FOREIGN
KEY referencing another table without specifying a column within that
table, then the PRIMARY KEY of that table will be used as the target of
the FOREIGN KEY.

I think.



Erik


В списке pgsql-general по дате отправления:

Предыдущее
От: Holger Klawitter
Дата:
Сообщение: BUG in lower
Следующее
От:
Дата:
Сообщение: Re: BUG in lower