Re: ALTER TABLE with multiple SET NOT NULL

2019-01-09 Thread Sergei Kornilov
Hello I investigate this bug and found reason: > alter table t1 add column b float8 not null default random(), add primary > key(a); Here we call ATController (src/backend/commands/tablecmds.c) with two cmds: AT_AddColumn and AT_AddIndex Then we go to phase 2 in ATRewriteCatalogs: - succesful

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