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

From teknokrat
Subject Re: Cannot add non-null columns
Date
Msg-id cjubmh$s7k$1@news.hub.org
Whole thread Raw
In response to Re: Cannot add non-null columns  (Miha Radej <miha.radej@siix.com>)
Responses Re: Cannot add non-null columns  (Andreas Pflug <pgadmin@pse-consulting.de>)
List pgadmin-support
Miha Radej wrote:
> 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.
> 

Sorry, I wasn't clear. This is an empty table. After creating it, I 
wanted to add some more columns. I used the properties of the table to 
try adding them but this failed. I then went to the column view and 
added them one at a time and that worked. This behaviour is inconsistent 
and should be fixed. There was no data in the table when I did this.


pgadmin-support by date:

Previous
From: "Dave Page"
Date:
Subject: Re: Multiple selections delete bug
Next
From: "Luis Antonio Martinez Cuevas"
Date:
Subject: postgres help