Redshift: alter table column TYPE is not allowed

Only allowed for varchar column types. The trick to get it done: ALTER TABLE sometable ADD COLUMN some_new_column (with the new definition you want) UPDATE sometable SET some_new_column = old_column; ALTER TABLE sometable DROP COLUMN old_column; ALTER TABLE sometable RENAME COLUMN some_new_column TO old_column; The catch: column order will be altered (the new column will […]