Re: Default values for nulls not being set.

Поиск
Список
Период
Сортировка
От Donald Fraser
Тема Re: Default values for nulls not being set.
Дата
Msg-id 001001c2e23d$76713bd0$1664a8c0@DEMOLITION
обсуждение исходный текст
Ответ на Default values for nulls not being set.  ("Donald Fraser" <demolish@cwgsy.net>)
Ответы Re: Default values for nulls not being set.
Список pgsql-bugs
> "Donald Fraser" <demolish@cwgsy.net> writes:
> > I have a major problem with DEAFAULT values:
>
> Consider attaching a default to the view column.  As-is, its default
> is NULL (and I can't see any good argument for the factory default
> being anything else).

What would be nice is when you don't specify a default on the view, the default
from the table is used.
That way, for most cases, you would only need to specify the default in one
place and not for every view...

regards Don.


> tt=# INSERT INTO vu_tbl_test (id, s_desc) VALUES('2', 'View insert test');
> ERROR:  ExecInsert: Fail to add null value in not null attribute b_disabled
> tt=# alter table vu_tbl_test alter column b_disabled set default '0';
> ALTER TABLE
> tt=# INSERT INTO vu_tbl_test (id, s_desc) VALUES('2', 'View insert test');
> INSERT 0 1
> tt=#
>
> regards, tom lane
>

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Default values for nulls not being set.
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Default values for nulls not being set.