Subject | [IBDI] Adding a NOT NULL column to a table |
---|---|
Author | Dmitry Yemanov |
Post date | 2001-07-04T07:25:59Z |
Hi,
If a table is altered to add a column, values of this new column become NULL
for all rows already existing in a table. Even if this new column has NOT
NULL option, the result is still the same. And we have values that violate
NOT NULL constraint. AFAIK, the only way to avoid this problem is to define
DEFAULT option for the new column which will be used to populate its values.
Does anyone know what the SQL standard says about it? Should data become
inconsistent when DEFAULT option is not used?
Cheers,
Dmitry
If a table is altered to add a column, values of this new column become NULL
for all rows already existing in a table. Even if this new column has NOT
NULL option, the result is still the same. And we have values that violate
NOT NULL constraint. AFAIK, the only way to avoid this problem is to define
DEFAULT option for the new column which will be used to populate its values.
Does anyone know what the SQL standard says about it? Should data become
inconsistent when DEFAULT option is not used?
Cheers,
Dmitry