Re: BUG #3542: Dropped and recreated columns have problems with NOT NULL contraints
В списке pgsql-bugs по дате отправления:
| От | Heikki Linnakangas |
|---|---|
| Тема | Re: BUG #3542: Dropped and recreated columns have problems with NOT NULL contraints |
| Дата | |
| Msg-id | 46C437E3.8050506@enterprisedb.com обсуждение исходный текст |
| Ответ на | BUG #3542: Dropped and recreated columns have problems with NOT NULL contraints ("Jens Schicke" <j.schicke@asco.de>) |
| Список | pgsql-bugs |
What did you expect? Jens Schicke wrote: > pizza_de=# alter table store_flags add column flag integer; > ALTER TABLE > pizza_de=# alter table store_flags drop column flag; > ALTER TABLE > pizza_de=# alter table store_flags add column flag integer not null; > ERROR: column "flag" contains null values The column was not added. It would've been filled with NULLs, which would violate the NOT NULL constraint. You have to give a DEFAULT if you add a column with a NOT NULL constraint. > pizza_de=# alter table store_flags drop column flag; > ERROR: column "flag" of relation "store_flags" does not exist The column doesn't exist, because the add column above failed, and was rolled back. > pizza_de=# alter table store_flags add column flag integer not null; > ERROR: column "flag" contains null values Same as above.. -- Heikki Linnakangas EnterpriseDB http://www.enterprisedb.com
В списке pgsql-bugs по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера