Re: Creating a column interger with default to not null

Поиск
Список
Период
Сортировка
От Adrian Klaver
Тема Re: Creating a column interger with default to not null
Дата
Msg-id 201009240811.55324.adrian.klaver@gmail.com
обсуждение исходный текст
Ответ на Creating a column interger with default to not null  (Chris Barnes <compuguruchrisbarnes@hotmail.com>)
Список pgsql-general
On Friday 24 September 2010 8:05:43 am Chris Barnes wrote:
> I am confused with what this is telling me.
> I have a table and I am trying to add a new column with constraint not
> null.
>
>
> What am I missing?
> Chris
>
>
> pgdb001=> alter table schema.table add COLUMN column_name integer not null;
> ERROR:  column "column_name" contains null values

The error message :) The column has NULLs in it so you can not make it NOT NULL
until you get rid of them.

--
Adrian Klaver
adrian.klaver@gmail.com

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

Предыдущее
От: Thom Brown
Дата:
Сообщение: Re: Creating a column interger with default to not null
Следующее
От: Craig Ringer
Дата:
Сообщение: Re: Restore/dump from "/usr/local/pgsql/data" directory