Re: Is this logical?

Поиск
Список
Период
Сортировка
От Stephan Szabo
Тема Re: Is this logical?
Дата
Msg-id 20060909145421.B74681@megazone.bigpanda.com
обсуждение исходный текст
Ответ на Is this logical?  ("Behrang Saeedzadeh" <behrangsa@gmail.com>)
Ответы Re: Is this logical?  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: Is this logical?  ("Behrang Saeedzadeh" <behrangsa@gmail.com>)
Список pgsql-general
On Sun, 10 Sep 2006, Behrang Saeedzadeh wrote:

> Shouldn't this create statement trigger an error?
>
>   create table bar (col1 int not null default null);
>
> Shouldn't I be forbidden to insert null values into a non null column?

I think it should forbid it when the default actually comes into play like
on insert or update, but not at create table time as there are no rows for
which the constraint fails.

For example after that:
sszabo=# insert into bar default values;
ERROR:  null value in column "col1" violates not-null constraint

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

Предыдущее
От: Ron Johnson
Дата:
Сообщение: Re: Is this logical?
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Is this logical?