Liquibase failed in creating DATABASECHANGELOG table on Redshift

Hi there,
When running “liquibase update” command agaist Redshift from my Mac with 4.22.0 Liquibase installation, I got the following error.

[2023-05-17 09:42:41] SEVERE [liquibase.integration] ERROR: syntax error at or near "TAG"
  Position: 286 [Failed SQL: (0) CREATE TABLE test.DATABASECHANGELOG (ID VARCHAR(255) NOT NULL, AUTHOR VARCHAR(255) NOT NULL, FILENAME VARCHAR(255) NOT NULL, DATEEXECUTED datetime NOT NULL, ORDEREXECUTED INT NOT NULL, EXECTYPE VARCHAR(10) NOT NULL, MD5SUM VARCHAR(35), DESCRIPTION VARCHAR(255), COMMENTS VARCHAR(255), TAG VARCHAR(255), LIQUIBASE VARCHAR(20), CONTEXTS VARCHAR(255), LABELS VARCHAR(255), DEPLOYMENT_ID VARCHAR(10))]
liquibase.exception.CommandExecutionException: liquibase.exception.DatabaseException: liquibase.exception.DatabaseException: ERROR: syntax error at or near "TAG"

It looks like TAG is a reserved keyword on Redshift, which caused the SQL statement failed.
Is this a bug on Liquibase? Is it possible to get around it?
Thanks!

Richard

Hi @Ricto,

Are you using the Redshift extension for Liquibase? You can find the documentation here: Using Liquibase with AWS Redshift

Once you’ve installed the liquibase-redhsift extension, it should handle the unique reserved words for Redshift, etc.

-PJ

Thanks PJ! The issue is resolved after I copied liquibase-redshift-4.22.0.jar to the liquibase/lib directory.

1 Like