Re: Cannot add non-null columns - Mailing list pgadmin-support

From Miha Radej
Subject Re: Cannot add non-null columns
Date
Msg-id 41629BE5.2080009@siix.com
Whole thread Raw
In response to Cannot add non-null columns  (teknokrat <teknokrat@yahoo.com>)
Responses Re: Cannot add non-null columns  (teknokrat <teknokrat@yahoo.com>)
List pgadmin-support
hi!

afaik you cannot add a not null column to a table because (in a table 
where there is already some data) the field values are null. the option 
to add a not null column perhaps only works on an empty table with no 
rows yet. so this behaviour is expected.
therefore you need to add a column, update the table to set the column 
values so there is no null fields and then you can alter the column to 
set it a default value, then again to set it no null. this always worked 
for me.

hope it helps.

regards,
Miha


teknokrat wrote:
> If I go to a tables properties and try adding a non-null column I get an 
> error. Adding the from the column view is OK.
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 8: explain analyze is your friend
> 



pgadmin-support by date:

Previous
From: teknokrat
Date:
Subject: Cannot add non-null columns
Next
From: "Dave Page"
Date:
Subject: Re: Multiple selections delete bug