June 27, 2003
Table Modifications in DB2
The schema changes keep piling up in my inbox and with each one I discover that I am unable to do something that would be quite trivial in another database. This week I have uncovered;
- It is not possible to make a NOT NULL nullable.
- Foreign key constraints cannot be disabled, they should just be dropped.
The first point is nonsense though. Why stop me changing a column to make its definition less restrictive? There is no technical reason for this unlike, say, the difficulties inherent in changing a column's data type. The only conclusion I can draw is that in DB2 the guiding principle is that you can't change columns - full stop.
Its their database, so I can't really argue. What I do know is that its making my life a little tricky. Its hard enough being agile and writing migration scripts for a data model. Its doubly hard when you can't modify anything in place.
Which leads me to an observation, is it just database vendors who make their manuals suitably vague? They are always full of "Product x will do a,b and c" but they never say what they won't do.
I suspect it has something to do with product liability - you know, if we don't mention it they can't sue us for not providing it - but I can't prove it. All I do know is that its as frustrating as hell sometimes when you are searching for a way to implement a feature only to find out that it doesn't exist.
Posted by Andy Todd at June 27, 2003 01:09 PM
And today I find that you can't make a nullable column NOT NULL either. Sheesh.
Posted by: Andy Todd on November 6, 2003 04:02 PM