Re: BUG #9088: default are not working

Поиск
Список
Период
Сортировка
От Thomas Kellerer
Тема Re: BUG #9088: default are not working
Дата
Msg-id 52F01888.4020808@gmx.net
обсуждение исходный текст
Ответ на BUG #9088: default are not working  (plademan@comcast.net)
Список pgsql-bugs
plademan@comcast.net wrote on 03.02.2014 23:23:> create table default_test
> (
>    userId   varchar(20)   default 'test',
>    date1    timestamp     default now(),
>    date2    timestamp     default current_timestamp,
>    date3    timestamp     default localtimestamp
> );
>
> insert into default_test
> ( userId, date1, date2, date3 )
> values
> ( null, null, null, null );
>
> select * from default_test;

You explicitely stated that you want to put NULL into those columns, therefor the default value does not apply.

The default value is only used if the colum is not listed at all in the INSERT statement.

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

Предыдущее
От: plademan@comcast.net
Дата:
Сообщение: BUG #9088: default are not working
Следующее
От: Marko Tiikkaja
Дата:
Сообщение: Re: BUG #9088: default are not working