Fix ALTER TABLE ADD COLUMN ... PRIMARY KEY so that the new column is correctly
commit065ce23b4e1c03bfb286296fe43915ef9bdbb922
authortgl <tgl>
Thu, 24 Apr 2008 20:17:50 +0000 (24 20:17 +0000)
committertgl <tgl>
Thu, 24 Apr 2008 20:17:50 +0000 (24 20:17 +0000)
tree40ec410c56855c83601915e65d20f2a80c15f064
parent83489d755c08ebe55871e3f849dc98daa7f12ce6
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