Re: Cannot add non-null columns

Поиск
Список
Период
Сортировка
Искать
От
Miha Radej
Тема
Re: Cannot add non-null columns
Дата
Msg-id
41629BE5.2080009@siix.com
Ответ на
Список
Дерево обсуждения
Cannot add non-null columns teknokrat <teknokrat@yahoo.com>
Re: Cannot add non-null columns Miha Radej <miha.radej@siix.com>
Re: Cannot add non-null columns teknokrat <teknokrat@yahoo.com>
Re: Cannot add non-null columns Andreas Pflug <pgadmin@pse-consulting.de>
Re: Cannot add non-null columns teknokrat <teknokrat@yahoo.com>
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 по дате отправления
От: teknokrat
Дата:
Сообщение: Cannot add non-null columns
От: Dave Page
Дата:
FAQ