Yes, use ALTER TABLE tbl ALTER COLUMN col SET DEFAULT 'foo'; and you won't rebuild the whole table.

You know, you can also just manually specify a value for that column in the LOAD DATA INFILE statement. I think you can anyway -- I always have to check the syntax on that one.

Baron

Bernd Jagla wrote:
Hi,

I am mass-importing A LOT of csv tables. In order to distinguish between
files I change the default value for the table before doing a "load data
infile.." from a Perl script:

ALTER TABLE `data` MODIFY COLUMN `sample_id` INTEGER UNSIGNED NOT NULL
DEFAULT $sample_id[$idx]

After importing a few hundred files I now realize that the table is copied
each time the "alter table statement is executed.
Is there a way to avoid this? I think there at least should be a way since
nothing in the structure is altered.
Please advise!

Thanks,

Bernd




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

Reply via email to