Re: Multicolumn primary key with null value

Поиск
Список
Период
Сортировка
От Said Ramirez
Тема Re: Multicolumn primary key with null value
Дата
Msg-id 4BD08A78.40807@vonage.com
обсуждение исходный текст
Ответ на Multicolumn primary key with null value  (Szymon Guz <mabewlun@gmail.com>)
Ответы Re: Multicolumn primary key with null value
Список pgsql-general
Primary keys are defined as 'unique not null' even if they are
composite. So I believe postgres would not let you do that:

5.3.4. Primary Keys

Technically, a primary key constraint is simply a combination of a
unique constraint and a not-null constraint.
....

A primary key indicates that a column or group of columns can be used as
a unique identifier for rows in the table. (This is a direct consequence
of the definition of a primary key. Note that a unique constraint does
not, by itself, provide a unique identifier because it does not exclude
null values.) This is useful both for documentation purposes and for
client applications.

http://www.postgresql.org/docs/8.1/static/ddl-constraints.html


Szymon Guz wrote:
> Does any SQL standard allows for a multicolumn primary key where in one record there is a null in on of the primary
keycolumns? 
>
> regards
> Szymon Guz

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

Предыдущее
От: Morgan Taschuk
Дата:
Сообщение: PSQL segmentation fault after setting host
Следующее
От: Tom Lane
Дата:
Сообщение: Re: PSQL segmentation fault after setting host