Neither column can be NULL if the column is part of the combination of primary key columns?

Поиск
Список
Период
Сортировка
От Emi Lu
Тема Neither column can be NULL if the column is part of the combination of primary key columns?
Дата
Msg-id 432B0475.90703@cs.concordia.ca
обсуждение исходный текст
Ответы Re: Neither column can be NULL if the column is part of the combination of primary key columns?  (Jaime Casanova <systemguards@gmail.com>)
Список pgsql-general
Greetings,

A question about "combination of several columns " as primary key .

A table test (
col1 timestamp not null default now(),
col2 timestamp,
primary key (col1, col2)
);

If I setup primary key as the *combination* of (col1, col2), the col2
will be setup as "NOT NULL" automatically right?
(Although, I did not specify not null constraint for col2)

To allow *col2* to be NULL and make record combination (col1, col2)
unique, I should setup
unique (col1, col2) ?

Thanks,
Emi





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

Предыдущее
От: Bill Moseley
Дата:
Сообщение: Re: Question about a query plan
Следующее
От: Russ Brown
Дата:
Сообщение: Re: Replication