I think that is absolutely a bad idea. Not only are you splitting data
that should logically be together, you will need to add three indexes
and perform three searched to get at the data. You typical index only
indexes from the start of the field, so even if you split the data, you
can't do con
nks,
Scott
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Monday, May 23, 2005 8:58 AM
To: Brent Baisley
Cc: Scott Purcell; mysql@lists.mysql.com
Subject: Re: varchar to text
Hi,
I we can, one should ask if it is a good solution ?
text can't be indexed as a varchar
Hi,
I we can, one should ask if it is a good solution ?
text can't be indexed as a varchar. You will need full-text indexing, or a
b-tree index on a length-limited :
mysql> create index titi on toto2(t);
ERROR 1170 (42000): BLOB/TEXT column 't' used in key specification without a key
length
mysql>
You can safely change varchar to text, since they are the same data
type.
ALTER TABLE table_name CHANGE field_name field_name TEXT
But, as always, make sure you have a recent backup. There is always the
possibility that your computer will crash in the middle of the
operation due to a stray ga
Changing types to larger shouldn't be an issue. If you are changing to
smaller, of course you are going to truncate the data more.
You do not need to move the data out and then back in again unless you
really want to.
mysql> ALTER TABLE tbl_name CHANGE `col1_old_name` `col1_new_name` text
default