Liquibase loadData doesn’t use my load my CSV but not error

I’m trying to load datas from a CSV with liquibase, my problem is that the script run and there is no error, but there is no data in my table, here is my configuration

<?xml version="1.0" encoding="UTF-8"?>
    <changeSet id="1" author="dev">
        <createTable tableName="products">
            <column name="code" type="varchar(3)">
                <constraints primaryKey="true"/>
            <column name="name" type="text"/>
    <changeSet id="2" author="dev">
        <loadData tableName="products"

In my file data_products.csv I have things like this


and here is my console log when I run my project :

2021-01-15 11:21:18.986  INFO 9540 --- [main] liquibase.changelog: Creating database history table with name: public.databasechangelog
2021-01-15 11:21:18.993  INFO 9540 --- [main] liquibase.changelog: Reading from public.databasechangelog
2021-01-15 11:21:19.047  INFO 9540 --- [main] liquibase.changelog: Table products created
2021-01-15 11:21:19.048  INFO 9540 --- [main] liquibase.changelog: ChangeSet liquibase/sql/1.0.0/init_db.xml::1::dev ran successfully in 8ms
2021-01-15 11:21:19.156  INFO 9540 --- [main] liquibase.changelog: Data loaded from data_products.csv into products
2021-01-15 11:21:19.156  INFO 9540 --- [main] liquibase.changelog: ChangeSet liquibase/sql/1.0.0/init_db.xml::2::dev ran successfully in 104ms
2021-01-15 11:21:19.160  INFO 9540 --- [main] liquibase.lockservice: Successfully released change log lock

I don’t know what is wrong with my configuration, since the log says that datas are loaded but when I do a select in my table, I’ve got nothing inside


I did find the solution, the problem is with the type in the column name,

If you use text for a type with liquibase it’s performed as a CLOB in database, and then it doesn’t load datas,

I just changed

        <column name="name" type="text"/>


        <column name="name" type="varchar"/>

without size and it worked !

Leave a Reply

Your email address will not be published. Required fields are marked *