<loadData> cannot import columns of type "timestamp with time zone" into PostgreSQL

The following CSV import fails when using PostgreSQL:


The <loadData> statement looks like this:

      <loadData file="liquibase/migrations/data/atl-77/test/default/csv/tl_activities.csv" tableName="tl_activities" usePreparedStatements="true">
         <column name="ID" type="UUID"/>
         <column name="PUBLISHED" type="timestamp(6) with time zone"/>
         <column name="ACTOR" type="UUID"/>
         <column name="OBJECT" type="UUID"/>
         <column name="SHA256SUM" type="VARCHAR(64)"/>

The exception is:

liquibase.exception.DatabaseException: org.postgresql.util.PSQLException: ERROR: column "published" is of type timestamp with time zone but expression is of type character varying

It seems that Liquibase does not set the value correctly in the prepared statement.

Is this a known bug, and does anybody know any workaround?

In ExecutablePreparedStatementBase.applyColumnParameter() the debugger tells me that col.getType() returns null, which leads to:

         } else {
            stmt.setString(i, col.getValue());

col.getValue() returns “2021-08-24T09:51:26.000Z”, as expected.

So, even though Liquibase supports the column type timestamp(6) with time zone when creating the table, it does not support it in <loadData>.

The problem is in LoadDataColumnConfig:

    public LoadDataChange.LOAD_DATA_TYPE getTypeEnum() {
        final String type = this.getType();
        if (type == null) {
            return null;
        if (this.loadType == null) {
            try {
                this.loadType = LoadDataChange.LOAD_DATA_TYPE.valueOf(type.toUpperCase());
            } catch (IllegalArgumentException e) {
                return LoadDataChange.LOAD_DATA_TYPE.UNKNOWN;
        return this.loadType;

The line this.loadType = LoadDataChange.LOAD_DATA_TYPE.valueOf(type.toUpperCase()) does not work for the type “timestamp(6) with time zone”.

Unfortunately Liquibase does not support time zones at all. ISODateFormat can only deal with zoneless timestamps, too.

I created issue 2068.