How to increase column size in Redshift database tables

redshift

In oracle, I can:

Alter table table_name
modify column_name datatype;

Is this possible in a redshift database?

Best Answer

In AWS Redshift is now possible to alter ONLY VARCHAR column but under these conditions:

  • You can’t alter a column with compression encodings BYTEDICT, RUNLENGTH, TEXT255, or TEXT32K.
  • You can't decrease the size less than maximum size of existing data.
  • You can't alter columns with default values.
  • You can't alter columns with UNIQUE, PRIMARY KEY, or FOREIGN KEY.
  • You can't alter columns inside a multi-statement block (BEGIN...END).

See the documentation.