Re: primary key question

Поиск
Список
Период
Сортировка
От Richard Huxton
Тема Re: primary key question
Дата
Msg-id 200211071019.58381.dev@archonet.com
обсуждение исходный текст
Ответ на primary key question  (Huub <v.niekerk@freeler.nl>)
Список pgsql-general
On Thursday 07 Nov 2002 6:57 am, Huub wrote:
> Hi,
>
> Reading the online manual it doesn't get clear to me: can I or can't I
> define a primary key containing 2 columns, e.g. like:
>
> create table <name> (column1 char(10) not null, column2 char(20) not
> null, primary key (column1, column2))

Yes you can. The place to check this sort of information is in the SQL
Commands reference section of the manuals.

From CREATE TABLE:
"The primary key constraint specifies that a column or columns of a table may
contain only unique (non-duplicate), non-NULL values. "

You might also find the functional and partial indexing features of interest.

--
  Richard Huxton

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

Предыдущее
От: Lee Kindness
Дата:
Сообщение: Re: replace text function
Следующее
От: 史绪良
Дата:
Сообщение: Q!