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  (teknokrat <teknokrat@yahoo.com>)
Список 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 по дате отправления:

Предыдущее
От: teknokrat
Дата:
Сообщение: Cannot add non-null columns
Следующее
От: "Dave Page"
Дата:
Сообщение: Re: Multiple selections delete bug