I need to modify a column which is currently defined as varchar(30) to
varchar(40). I can see from the docs (and trial) that I cannot directly
alter a column this way, so I intend to do the following:
ALTER TABLE t1 ADD COLUMN duplicate varchar(40);
UPDATE t1 SET duplicate=original;
ALTER TABLE t1 DROP COLUMN original;
ALTER TABLE t1 RENAME duplicate TO original;
But I'm worried about messing up things if I run this queries while the
database is live, i.e. there are other processes writing to the table. Now,
if I enclose the above into a BEGIN/COMMIT pair, would you say it is safe to
run concurrently with other transactions?
TIA,
cl.