Re: Unique primary index?

Поиск
Список
Период
Сортировка
От Bruno Wolff III
Тема Re: Unique primary index?
Дата
Msg-id 20050628125318.GC20566@wolff.to
обсуждение исходный текст
Ответ на Unique primary index?  (orange_crush_068@hotmail.com)
Список pgsql-sql
On Thu, Jun 23, 2005 at 05:43:52 -0700, orange_crush_068@hotmail.com wrote:
> 
> What are the major differences between Unique, primary index & just
> plain index?
> 
> When creating tables I nominate one of these, but not sure what the
> difference is?

A unique key has an implied constraint that no two nonnull values can
be the same. This is implemented using a unique index which is automatically
created.

A primary key is a unique key that has an implied not null constraint and
is the default for foreign key references into the table.

You can also create stand alone indexes for performance reasons or to
enforce a unique constraint on a subset of a table.


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

Предыдущее
От: Bruno Wolff III
Дата:
Сообщение: Re: cross-table reference
Следующее
От: PFC
Дата:
Сообщение: Re: Unique primary index?