Liquibase claims can't connect to database Redshift

This is a bug. The behavior changes if I create a database called redshift.

This is my URL from my properties file:

url=jdbc:redshift://foobar.db.dev.mydomain.com:5439/dev

Note: I am using a FQDN which is mapped thru a cloud security platform. I know the database is accessible as I can hit it from both psql and a java script using the same JDBC driver.

I strongly beleive that liquibase is mucking with the target database for the connection.

here is output after I create redshift database:

dev=# create database redshift;
CREATE DATABASE
dev=# \q
➜  liquibase liquibase update-sql --changelog-file=changelogs/db.changelog-master.yaml

####################################################
##   _     _             _ _                      ##
##  | |   (_)           (_) |                     ##
##  | |    _  __ _ _   _ _| |__   __ _ ___  ___   ##
##  | |   | |/ _` | | | | | '_ \ / _` / __|/ _ \  ##
##  | |___| | (_| | |_| | | |_) | (_| \__ \  __/  ##
##  \_____/_|\__, |\__,_|_|_.__/ \__,_|___/\___|  ##
##              | |                               ##
##              |_|                               ##
##                                                ## 
##  Get documentation at docs.liquibase.com       ##
##  Get certified courses at learn.liquibase.com  ## 
##                                                ##
####################################################
Starting Liquibase at 13:59:48 using Java 21.0.2 (version 4.29.1 #3316 built at 2024-07-30 20:15+0000)
Liquibase Version: 4.29.1
Liquibase Open Source 4.29.1 by Liquibase
-- Create Database Lock Table
CREATE TABLE DATABASECHANGELOGLOCK (ID INT NOT NULL, LOCKED BOOLEAN NOT NULL, LOCKGRANTED datetime, LOCKEDBY VARCHAR(255), CONSTRAINT PK_DATABASECHANGELOGLOCK PRIMARY KEY (ID));

-- Initialize Database Lock Table
DELETE FROM DATABASECHANGELOGLOCK;

INSERT INTO DATABASECHANGELOGLOCK (ID, LOCKED) VALUES (1, FALSE);

-- Lock Database
UPDATE DATABASECHANGELOGLOCK SET LOCKED = TRUE, LOCKEDBY = 'KSKYCMX52W60 (10.0.0.45)', LOCKGRANTED = CURRENT_TIMESTAMP WHERE ID = 1 AND LOCKED = FALSE;

-- Release Database Lock
UPDATE DATABASECHANGELOGLOCK SET LOCKED = FALSE, LOCKEDBY = NULL, LOCKGRANTED = NULL WHERE ID = 1;

ERROR: Exception Details
ERROR: Exception Primary Class:  RedshiftException
ERROR: Exception Primary Reason:  ERROR: syntax error at end of input
  Position: 20
ERROR: Exception Primary Source:  Redshift 8.0.2

Unexpected error running Liquibase: ERROR: current transaction is aborted, commands ignored until end of transaction block
  - Caused by: ERROR: syntax error at end of input
  Position: 20

For more information, please use the --log-level flag

Please Advise.

Cheers!

-Charles

@cphares thanks for bringing this issue up. I’m not sure about specifics, but if you do believe this is a bug with Liquibase, I would encourage you to file an issue in the core repo: Sign in to GitHub · GitHub

Liquibase also has a community-maintained Redshift extension (GitHub - liquibase/liquibase-redshift: Liquibase support for Redshift). I looked there, but did not see a similar issue.