Explicitly inserting NULL values into NOT NULL DEFAULT 0 columns

Поиск
Список
Период
Сортировка
От Tanmay Patel
Тема Explicitly inserting NULL values into NOT NULL DEFAULT 0 columns
Дата
Msg-id CAGgjfiTX+m1DKxSti7EQXdCgO-swqEF28kf=g6Jv9RK=KkWTqA@mail.gmail.com
обсуждение исходный текст
Ответы Re: Explicitly inserting NULL values into NOT NULL DEFAULT 0 columns  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: Explicitly inserting NULL values into NOT NULL DEFAULT 0 columns  (Scott Marlowe <scott.marlowe@gmail.com>)
Список pgsql-general
If I insert a NULL value explicitly into a column declared to be NOT NULL DEFAULT 0 in postgreSQL 8.4 the column ends up with the default value. If I do the same in postgreSQL 9.0 I get an error about how I am inserting a null value into a NOT NULL column.

i.e.: insert into table1 (column1, column2) values (0, NULL); where column2 is of type integer with attributes NOT NULL DEFAULT 0

In both cases if I just don't mention the column with these attributes the value stored is the default value.

i.e.: insert into table1(column1) values (0); where column2 is of type integer with attributes NOT NULL DEFAULT 0

I looked through all the release notes between the versions in question and can find nothing mentioning this change. When did this change occur, and can I choose to keep the behavior as it was in postgreSQL 8.4?

Thanks,

Tanmay

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

Предыдущее
От: Adrian Klaver
Дата:
Сообщение: Re: how could duplicate pkey exist in psql?
Следующее
От: Pavel Stehule
Дата:
Сообщение: Re: stored function data structures - difficulty