Re: Explicitly inserting NULL values into NOT NULL DEFAULT 0 columns

Поиск
Список
Период
Сортировка
От Scott Marlowe
Тема Re: Explicitly inserting NULL values into NOT NULL DEFAULT 0 columns
Дата
Msg-id CAOR=d=3dK4wj9808hneDV5T4yO1qErsQL6=FMm0_XFi1O7DPyA@mail.gmail.com
обсуждение исходный текст
Ответ на Explicitly inserting NULL values into NOT NULL DEFAULT 0 columns  (Tanmay Patel <tan.patel.may@gmail.com>)
Ответы Re: Explicitly inserting NULL values into NOT NULL DEFAULT 0 columns  (Etienne Rouxel <rouxel.etienne@gmail.com>)
Список pgsql-general
On Mon, Nov 21, 2011 at 5:27 PM, Tanmay Patel <tan.patel.may@gmail.com> wrote:
> 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.

As Tom pointed out you are mistaken.  That's a MySQLism.  If you want
to insert defaults, use the DEFAULT keyword in place of where you're
trying to put NULL.

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Explicitly inserting NULL values into NOT NULL DEFAULT 0 columns
Следующее
От: Ashesh Vashi
Дата:
Сообщение: Re: Installing postgresql on windows 7