Search Postgresql Archives

Explicitly inserting NULL values into NOT NULL DEFAULT 0 columns

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux