Re: Creating a column interger with default to not null - Mailing list pgsql-general

From Adrian Klaver
Subject Re: Creating a column interger with default to not null
Date
Msg-id 201009240811.55324.adrian.klaver@gmail.com
Whole thread Raw
In response to Creating a column interger with default to not null  (Chris Barnes <compuguruchrisbarnes@hotmail.com>)
List 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 by date:

Previous
From: Thom Brown
Date:
Subject: Re: Creating a column interger with default to not null
Next
From: Craig Ringer
Date:
Subject: Re: Restore/dump from "/usr/local/pgsql/data" directory