Re: Is this logical?

Поиск
Список
Период
Сортировка
От Behrang Saeedzadeh
Тема Re: Is this logical?
Дата
Msg-id 2991d56c0609091526s4643d67asa0001decc4c94bad@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Is this logical?  (Stephan Szabo <sszabo@megazone.bigpanda.com>)
Ответы Re: Is this logical?  (Ron Johnson <ron.l.johnson@cox.net>)
Re: Is this logical?  (Sim Zacks <sim@compulab.co.il>)
Список pgsql-general
Stephan,

But "not null" is in contradiction with "default null" so the create
statement should not proceed successfuly IMHO.

Regards,
Behi

On 9/10/06, Stephan Szabo <sszabo@megazone.bigpanda.com> wrote:
> 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
>


--
"We can only see a short distance ahead,
but we can see plenty there
that needs to be done." - Alan Turing

"Science is a differential equation. Religion
is a boundary condition" - Alan Turing

Behrang Saeedzadeh
http://www.jroller.com/page/behrangsa
http://my.opera.com/behrangsa

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

Предыдущее
От: Dave Cramer
Дата:
Сообщение: Re: Idle in transaction state.
Следующее
От: "Behrang Saeedzadeh"
Дата:
Сообщение: Re: Is this logical?