Re: ALTER TABLE with multiple SET NOT NULL

2019-01-04 Thread Tom Lane
Allison Kaptur writes: > I encountered a surprising error when writing a migration that both added a > primary key to a table and added a new NOT NULL column. It threw the error " > column "col_d" contains null values", even though I supplied a default. The > migration looks like this: > CREATE TA

ALTER TABLE with multiple SET NOT NULL

2019-01-04 Thread Allison Kaptur
Hi folks, I encountered a surprising error when writing a migration that both added a primary key to a table and added a new NOT NULL column. It threw the error " column "col_d" contains null values", even though I supplied a default. The migration looks like this: CREATE TABLE new_table AS SELECT