David Griffiths wrote:

But the reason modern databases have foreign keys, primary keys, not-nulls, check constraints and data-metadata (char(5), INT, BIGINT, etc) is to prevent bad data from going in.. If no exception is thrown because you are trying to put a BIGINT into an INT, then why throw one if you try to insert a NULL into a NOT-NULL column (assuming no DEFAULT is present)? Or what about foreign keys? Why not just quietly fail if a fk-constraint is violated?

But a column type isn't a constraint. If integer types were about defining a range of acceptable data, then you'd be able to define one that held only integers between 1 and 100, for example. Column types are about storage, and sorting, and maybe some other things, but they're not a good way to handle constraints, even in databases that throw exceptions.


Your general point is a reasonable way of looking at things, but it's not the MySQL philosophy, and that's one of the things that makes MySQL fast.

--
Keith Ivey <[EMAIL PROTECTED]>
Washington, DC


-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]



Reply via email to