01.04.2011 12:05, Kjell Rilbe wrote: > While writing this, I do feel that it would be rather nice if Firebird > could automatically do all this: > > 1. Transliterate/cast existing data to new type, raising erors if data > can't be converted.
FWIW, this is somewhat against the design Firebird inherits from its predecessor. Our DDL is cheap and fast, and it locks nobody. A new metadata version (table format) is created and that's all. All existing records uses the prior format but can be upgraded to the latest one if required. The cost is that runtime validations are impossible (in fact, they just don't make sense as we want to avoid data access during DDL) and thus we may allow only changes that are guaranteed to be compatible with the existing data. The problem, however, is that some DDL changes just cannot be done without validating the data. The nullable -> not null change was the first one that required the extra processing. Now we're discussing another one. Personally, I don't see problems with combining both approaches, i.e. use the fast "versioning" mode for the a priori valid changes and perform the explicit validation for possibly problematic changes. This way we could easily allow altering string columns to shorter lengths, altering strings to numerics, etc. Someone just needs to implement all these checks :-) Dmitry ------------------------------------------------------------------------------ Create and publish websites with WebMatrix Use the most popular FREE web apps or write code yourself; WebMatrix provides all the features you need to develop and publish your website. http://p.sf.net/sfu/ms-webmatrix-sf Firebird-Devel mailing list, web interface at https://lists.sourceforge.net/lists/listinfo/firebird-devel