Fix ALTER TABLE ADD COLUMN ... PRIMARY KEY so that the new column is correctly
authorTom Lane <tgl@sss.pgh.pa.us>
Thu, 24 Apr 2008 20:18:07 +0000 (20:18 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Thu, 24 Apr 2008 20:18:07 +0000 (20:18 +0000)
commit29bf7b00a8291e7b5aa2fe1c636358fa98619558
tree6aebf1ee79ac1e00b95428768f78a2e62cb1ffc3
parent0861266bab20e12946047d9fcc806c6eab1083df
Fix ALTER TABLE ADD COLUMN ... PRIMARY KEY so that the new column is correctly
checked to see if it's been initialized to all non-nulls.  The implicit NOT
NULL constraint was not being checked during the ALTER (in fact, not even if
there was an explicit NOT NULL too), because ATExecAddColumn neglected to
set the flag needed to make the test happen.  This has been broken since
the capability was first added, in 8.0.

Brendan Jurd, per a report from Kaloyan Iliev.
src/backend/commands/tablecmds.c
src/test/regress/expected/alter_table.out
src/test/regress/sql/alter_table.sql