]> granicus.if.org Git - postgresql/commit
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:15 +0000 (20:18 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Thu, 24 Apr 2008 20:18:15 +0000 (20:18 +0000)
commit1fb9814d708082edad108dbce779b689a554d43f
tree822c47a789a177a64787dcb1b66fda0cc3fd5a4b
parent0f130711d0b9137be5dd55525f6f98d0176760c2
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