Liquibase update command fail on Redshift

Hi guys,
I’m very new to Liquibase and trying to use Liquibase to create and maintain schema on Redshift.
I downloaded and installed latest Liquibase package (v4.22.0) to my Mac. Downloaded redshift-jdbc42-2.1.0.14.jar and specified the correct class path in the liquibase.properties.

# Type of database
driver: com.amazon.redshift.jdbc.Driver

# Connection details
url: xxx
username: xxx
password: xxx

# Liquibase details
changeLogFile: changelog.xml
classpath: redshift-jdbc42-2.1.0.14.jar

However when running ‘liquibase update’ command, I got the following error.

Unexpected error running Liquibase: ERROR: current transaction is aborted, commands ignored until end of transaction block [Failed SQL: (0) CREATE TABLE DATABASECHANGELOGLOCK (ID INT NOT NULL, LOCKED BOOLEAN NOT NULL, LOCKGRANTED datetime, LOCKEDBY VARCHAR(255), CONSTRAINT PK_DATABASECHANGELOGLOCK PRIMARY KEY (ID))]
  - Caused by: ERROR: syntax error at end of input
  Position: 20

I ran this SQL command directly in my Redshift QueryEditor console and it was successful. I’m not sure why it complained about syntax error.

Does anyone has clues on what might cause this and know how to resolve it?
Thanks in advance!

Richard

Hi @Ricto,

Are you using the liquibase-redshift extension? You can see more details here: Using Liquibase with AWS Redshift

-PJ

Thanks PJ! The issue is resolved by copying liquibase-redshift-4.22.0.jar to the liquibase/lib directory.

1 Like