Paul DuBois wrote:
Behrang Saeedzadeh wrote:
Hi,

Could someone help this guy work around this problem in MySQL:
http://www.redhillconsulting.com.au/blogs/simon/archives/000347.html

I think the answer to his questions lies in the manual:

http://dev.mysql.com/doc/refman/5.0/en/data-type-defaults.html

If a column is NOT NULL and contains no DEFAULT clause in its
definition, the default is the implicit default for the column's
data type.

That's with strict mode disabled; in strict mode, columns with no
DEFAULT clause must be given a value.

This behavior sounds pretty logical to me, besides the fact that it is designed like that. Why would you try to put a NULL value in a column that you explicitly have forbidden to contain NULL values? In my opinion you don't know what you are doing when you use a CREATE query in which you define a column that can't be NULL and after that add a default value of NULL. So it seems logical that MySQL defined a default value for every type. So it is not comparable with M$ Access. If he says that you can do this with PostgreSQL, then I get the feeling that it is a flaw in the software. And might cause unexpected errors in programs. I guess I am also biased as I am very fond of MySQL...

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

Reply via email to