Hello,

I believe that MySQL is in error in reporting the following message just
because I did not specify that the PRIMARY KEY should not be NULL. These
days there are standards and SQL92, AFAIK, specifies that if the primary
key is not explicitly set to NOT NULL then the RDBMS should automatically
and silently assume the user means NOT NULL. After all, any half decent
book on relational databases out there will tell you that primary keys
cannot be null. So why does MySQL do it this way. By doing this MySQL is
breaking the portability of my standard SQL code which works so well with
postgreSQL and Oracle 9i. So why donesn't MySQL play nice and abide to
the standard? Is this fixed in MySQL 4? I am running MySQL 3.23.54a as
distributed with Red Hat 9, which, for some reason has not decided to
update their mysql RPMS to MySQL 4 for that release but I am interesting
in knowing if this has been fixed in MySQL. I think one of MySQL's goals
should be to support standards such as SQL92 (if not SQL99). Even if
internally some things don't work as expected, at a minimum, the
parsers should be compatible as much as possible, including
standard data types and assuming primary keys are not null
by default.

ERROR 1171: All parts of a PRIMARY KEY must be NOT NULL;  If you need NULL 
in a key, use UNIQUE instead

BTW, for those willing to check it out, Part 1 (as well as other parts) of
the SQL standard are available from http://webstore.ansi.org/ for 18 bucks
as standard INCITS/ISO/IEC 9075-1-1999. The older standard is also 
available as ANSI INCITS 135-1992 (R1998) at the same price.

Regards,

Neil


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

Reply via email to