fpaul,
Wednesday, September 11, 2002, 11:00:56 AM, you wrote:

faadn> I have a problem with the command ALTER TABLE.
faadn> For example, this simple table "test" :
faadn> +---------+---------------+------+-----+---------+----------------+
faadn> | Field   | Type          | Null | Key | Default | Extra          |
faadn> +---------+---------------+------+-----+---------+----------------+
faadn> | id      | int(10)       |      | PRI | NULL    | auto_increment |
faadn> | texte   | varchar(255)  | YES  |     | NULL    |                |
faadn> +---------+---------------+------+-----+---------+----------------+

faadn> I want to modify the id column and convert it to tinyint type. The command line
faadn> is :

faadn> ALTER TABLE test MODIFY COLUMN id tinyint(3) unsigned NOT NULL PRIMARY KEY
faadn> default NULL auto_increment;

faadn> I launch it and I have this error :

faadn> ERROR 1068: Multiple primary key defined

ALTER TABLE test MODIFY COLUMN id tinyint(3) unsigned auto_increment;

faadn> Obviously if I remove the PRIMARY KEY, it does not begin squalling...
faadn> The problem is that it's an automatic program which launches the ALTER TABLE so
faadn> I'll be happy if I can keep the "PRIMARY KEY".
faadn> This was tested on a MySQL 4.0.2 as well as on 3.23.51.
faadn> Is it a limit of ALTER ? A syntax error ?... Thank for your answers and sorry



-- 
For technical support contracts, goto https://order.mysql.com/?ref=ensita
This email is sponsored by Ensita.net http://www.ensita.net/
   __  ___     ___ ____  __
  /  |/  /_ __/ __/ __ \/ /    Egor Egorov
 / /|_/ / // /\ \/ /_/ / /__   [EMAIL PROTECTED]
/_/  /_/\_, /___/\___\_\___/   MySQL AB / Ensita.net
       <___/   www.mysql.com




---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to