I ran a Liquibase Update command on an xml changelog file to increase the max length of an existing text field on Redshift.
The xml snippet is as follows:
<changeSet author="ric" id="1684847295235-1"> <modifyDataType columnName="name__v" newDataType="varchar(256)" tableName="aggregate_report"/> </changeSet>
I received the following error message:
Unexpected error running Liquibase: Migration failed for changeset diff-change-log-updated.xml::1684847295235-1::ric: Reason: liquibase.exception.DatabaseException: ERROR: ALTER TABLE ALTER COLUMN does not support USING expression [Failed SQL: (0) ALTER TABLE demo.aggregate_report__v ALTER COLUMN name__v TYPE VARCHAR(256) USING (name__v::VARCHAR(256))]
I checked the Redshift document and confirmed Redshift ALTER TABLE command does not support USING expression. Is this a bug on Liquibase or I misconfigured it so that it didn’t generate Redshift compatiable SQLs? My other changes, such as schema and table creation and column dropping works with Redshift though.
I’m using Liquibase (v4.22.0) on a Mac.
Any help would be highly appreciated!