Introducing Agent Safe Governance for the AI Era

Connect Liquibase with AlloyDB for Postgres

Last updated: November 18, 2025

AlloyDB is a fully managed, PostgreSQL-compatible database service from Google Cloud that is built for demanding workloads.

Before you begin

  • Install Liquibase

  • Ensure you have Java installed. Liquibase requires Java to run. If you used the Liquibase Installer, Java is included automatically. Otherwise, you must install Java manually.

Procedure

1

(Maven users only) Configure Maven

If you're running Liquibase using the Maven plugin using mvn liquibase:update installing the extension with Maven ensures the right files are available and everything works together automatically. You can manage these extensions by adding them as dependencies in your project’s pom.xml file. When configured this way, Maven automatically downloads the specified JAR files from Maven Central during the build process.

2

Configure connection

1. Ensure your database is configured.

2. Specify the database URL in the liquibase.properties file (defaults file), along with other properties you want to set a default value for. Liquibase does not parse the URL. You can either specify the full database connection string or specify the URL using your database's standard connection format:

url: jdbc:postgresql://<host>:<port>/<dbname>

3. Set your schema. You can use the PUBLIC schema with AlloyDB, but this may lead to unexpected behavior. We recommend you create and use a custom (non-default) schema.

defaultSchemaName=mySchema

liquibase --defaultSchemaName=mySchema

loading
3

Test your connection

1. Create a text file called changelog (.sql, .yaml, .json, or .xml) in your project directory and add a changeset.

If you already created a changelog using the init project command, you can use that instead of creating a new file. When adding onto an existing changelog, be sure to only add the changeset and to not duplicate the changelog header.

loading

loading

loading

loading

2. Navigate to your project folder in the CLI and run the Liquibase connect command to see whether the connection is successful.

liquibase connect

Result
loading