loadData fails for Postgres when column is of an enum type.

Description

Database: Postgres.

This is the changeSet I was having trouble with:

<changeSet author="sudipto" id="1580107122999-11" runOnChange="true"> <loadData commentLineStartsWith="#" encoding="UTF-8" file="data/xxx_mapping.csv" quotchar="&quot;" relativeToChangelogFile="true" separator="," tableName="xxx_mapping"> <column header="xxxxxx_id" name="tenant_id" type="NUMERIC"/> <column header="xxxxx_id" name="vendor_psl_id" type="NUMERIC"/> <column header="xxxx_id" name="vendor_id" type="NUMERIC"/> <column header="xxx_score" name="financial_score" type="NUMERIC"/> <column header="xxx_status_id" name="vendor_psl_status_id" type="NUMERIC"/> <column header="xxx_type" name="user_type" type="STRING"/> <column header="calendar_date" name="calendar_date" type="DATE"/> <column header="audit_id" name="audit_id" type="NUMERIC"/> </loadData> </changeSet>

The column - xxx_type was failing during update because it's of an enum type.

As part of this improvement, we'll add a type - OTHER (similar (exactly similar) to java.sql.Types.OTHER). This will not only handle enum types during data load for Postgres, but also many other kinds of datatypes that are supported by java.sql.Types.OTHER.

Environment

Operating System - macOS Mojave - 10.14.6
Java version - 1.8
Liquibase version - 3.8.5 (Please note that the {{Affects versions}} doesn’t list 3.8.5)

Activity

Show:

Sudipto Sarkar January 31, 2020 at 7:09 AM

Details

Reporter

Affects versions

Priority

Created January 31, 2020 at 6:44 AM
Updated January 31, 2020 at 7:09 AM