ALTER TABLE ALTER COLUMN cannot run inside a transaction block; I am trying to alter column in redshift from varchar(30) to Varchar(100) Its not working througing an below error. 

Command used:

alter table t_name alter column c1 type varchar(300);


Error:

[Amazon](500310) Invalid operation: ALTER TABLE ALTER COLUMN cannot run inside a transaction block; [SQL State=25001, DB Errorcode=500310]
From AWS Documentation Check if you are violating any conditions..


  ALTER COLUMN column_name TYPE new_data_type A clause that changes the
  size of a column defined as a VARCHAR data type. Consider the
  following limitations:
  
  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 within a transaction block (BEGIN ... END).
  For more information about transactions, see Serializable isolation.