Hi, I am currently using spring boot version 3.3.7 and liquibase version is 4.27.0 (auto managed by spring boot). I have a liquibase job in my system which runs and updates a database. Whenever I am upgrading Spring Boot to 3.3.8, the liquibase job fails with error message

Wrapped by: liquibase.exception.DatabaseException: ERROR: relation "databasechangelog" already exists [Failed SQL: (0) CREATE TABLE public.databasechangelog (ID VARCHAR(255) NOT NULL, AUTHOR VARCHAR(255) NOT NULL, FILENAME VARCHAR(255) NOT NULL, DATEEXECUTED TIMESTAMP WITHOUT TIME ZONE NOT NULL, ORDEREXECUTED INTEGER 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))]
    at liquibase.executor.jvm.JdbcExecutor$ExecuteStatementCallback.doInStatement(JdbcExecutor.java:473)
    at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:80)
    at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:182)
    at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:150)
    .... followed by a big stack strace

I saw many similar issues being raised and asked about, but nowhere I have found anything related to liquibase after upgrading spring boot from 3.3.7 to 3.3.8. Please note that the liquibase URL and credentials are all correctly in place.

Is there any additional property or adjustment I need to do ? @snicoll Any help would be appreciated.

Comment From: wilkinsona

As you can see by looking at the changelog, there weren't any changes to Spring Boot's Liquibase support in 3.3.8. The only change that looks like it could be related is "Upgrade to Postgresql 42.7.5 #43842" but you haven't said which database you're using so it may not apply here.

Comment From: zenith7781

Sorry for missing the information @wilkinsona , it is a postgresql database and the postgresql version is 42.7.5 which is again auto managed by spring boot 3.3.8. The first line of stacktrace goes as

20-liquibase-11-zd227:7:main] ERROR o.s.boot.SpringApplication Application run failed
org.postgresql.util.PSQLException: ERROR: relation "databasechangelog" already exists
    at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2733)
        at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:372)
    at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:517)
    at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:434)

I also went to the link #43842 but there are just too many large commits to analyze which one can be beneficent. Can you or @davecramer or any relevant person please highlight the commits which is/can be relevant to this "databasechangelog" table creation issue under "public" schema ?

Also let me know if I missed some information again. Thanks

Comment From: wilkinsona

Please start by downgrading to Postgres 42.7.4 and check that it solves the problem.

Comment From: davecramer

Very curious about this

Comment From: jankohlmann

See https://github.com/liquibase/liquibase/issues/6666

TLDR: pgjdbc 42.7.5 introduced https://github.com/pgjdbc/pgjdbc/pull/3390 with exact catalog/database name matching and liquibase formats the database name to lower case if all characters are upper case

Comment From: aheritier

I also noticed a very important slowness when I start the app or run the tests since the upgrade from SB 3.3.7 to 3.3.8 I was expecting a liguibase change but there is not. I also use postgresql. I downgraded postgresql (<postgresql.version>42.7.4</postgresql.version>) while keeping SB 3.3.8 and it restores the previous performances. There is a regression in the upgrade 42.7.4 to 42.7.5.

Comment From: aheritier

@jankohlmann nice catch !! Our comments were sent almost at the same time. You have the root cause. And I confirm that downgrading the driver is a valid workaround

Comment From: wilkinsona

Thanks, both. This will have to be addressed in Liquibase and/or Postgres's JDBC driver.

Comment From: zenith7781

Hi @wilkinsona , as you suggested explicitly downgrading postgresql to 42.7.4 and keeping spring boot to 3.3.8, like @aheritier does fix the liquibase issue 🙂