Subject Re: [Firebird-Architect] Extended field/domain DEFAULT usage
Author Martijn Tonies
> >News for you :-)
> >
> >If you add a required column (not NULL) to a table with existing data,
> >and include a default for that column, you'll get this behaviour.
> >
> >
> >
> You're kidding? When did that happen? Did anyone actually think about
> it first?

IB6, I think ... I guess there was some thought given to the idea, at least
to make databases restorable.

> When a constraint is added, one can make an argument that the table
> should be validated after adding the constraint, then removing the
> constraint and throwing an error. My preference is to add the
> constraint in the assumption that the user has or will fix the data.

Well yes, but given that users usually don't do that UNLESS explicitly
asked for ...

> To make sure that all backups are restorable, provision should be made
> to relax the constraint so the data can be loaded and fixed.

Agreed. Or, as I wrote earlier, the problem could/should have been
avoided in the first place.

Martijn Tonies
Database Workbench - tool for InterBase, Firebird, MySQL, Oracle & MS SQL
Server
Upscene Productions
http://www.upscene.com
Database development questions? Check the forum!
http://www.databasedevelopmentforum.com