Using Liquibase with Informix

The purpose of this document is to guide you through the process of creating a new Liquibase project with Informix. In this tutorial, you will learn how to generate an example project and follow the instructions to apply concepts associated with creating new Liquibase projects with Informix.


Before using Liquibase with your database, ensure you have:

  • Created an Informix database in the ANSI mode to enable implicit transactions by using the following statement:

    For more information, see CREATE DATABASE statement: Logging Options.

  • Download the JDBC jar driver file.
  • Note: Place your JDBC jar file in the liquibase/lib install directory or in any other known directory so you can locate it easily.


To create a Liquibase project with Informix, perform the following steps:

  1. Add the following properties to the newly created Liquibase properties file:
changelog-file: dbchangelog.xml
url: jdbc:informix-sqli://localhost:9088/dbname:INFORMIXSERVER=dbserver
username: user1
password: password
driver: com.informix.jdbc.IfxDriver
classpath: ../../Liquibase_Drivers/jdbc-

Note: Specifying your password, take into account that Liquibase supports only the following special characters: ~ # $ % * ( ) - _ + [ ] { } . ?. Unsupported special characters are as follows: @ & / : < > " ' ` | ^ ! = , \ <spaces>.

If you placed the jar file in the liquibase/lib install directory, do not specify the classpath property in the Liquibase properties file. Otherwise, specify the path to the driver as shown in the preceding example.

Tip: To apply a Liquibase Pro key to your project, add the following property to the Liquibase properties file: liquibaseProLicenseKey: <paste code here>

  1. In your project folder, create a new text file and name it dbchangelog.xml. The changelog files contain a sequence of changesets, each of which makes small changes to the structure of your database.

Note: Instead of creating an empty changelog file, you can use an existing database to generate a changelog. In this tutorial, you will manually add a single change. To add this change, open the XML file and update the changelog file with the following code snippet:

<?xml version="1.0" encoding="UTF-8"?>
  1. Add a changeset to the changelog. The changesets are uniquely identified by author and id. Liquibase attempts to execute each changeset in a transaction that is committed at the end. In the dbchangelog.xml file, add a new createTable changeset as follows:
  1. Navigate to your project folder in the CLI and run the Liquibase status command to see whether the connection is successful. You can pass arguments in the CLI or keep them in the Liquibase properties file.
  2. liquibase --username=test --password=test --changelog-file=<changelog.xml> status
  3. Run your first update with the update command, which makes changes to your database. You can also run the update-sql command to inspect the SQL before running the update command.
  4. liquibase --changelog-file=<changelog.xml> update-sql
    liquibase --changelog-file=<changelog.xml> update

From a database UI tool, ensure that your database contains the table you added along with the DATABASECHANGELOG table and DATABASECHANGELOGLOCK table.

Troubleshooting issues with the formatted SQL procedure

When you add a changeset with the procedure but receive an error message during the runtime, add the splitStatements attribute set to false to your changeset as follows:

--changeset bob:5 splitStatements:false
CREATE PROCEDURE raise_prices ( per_cent INT)
        UPDATE stock SET unit_price = unit_price + (unit_price * (per_cent/100) );