What causes "ClobType doesn't support precision but precision was specified"?

We’re attempting to upgrade from Liquibase 1.9.5 to 2.0-rc2 and ran into a bit of a showstopper.  Couldn’t see any obvious fix in the forums after an initial search, other than perhaps using the modify-column.jar (from http://liquibase.jira.com/wiki/display/CONTRIB/ModifyColumn+Change), though I’m not sure how that’d modify the XSD to allow .

The error message seems misleading since it mentions 7 changes having validation errors.  Seems like there should be 0, 12, or 24 errors.  Odder still, if I comment out all the elements I still get the same validation errors (huh?) so I’m not sure what it’s complaining about.

Any ideas where to start looking?

Thanks,
Martin

Liquibase version: 2.0-rc2 (5/11/2010) - CI build server is down right now so I can’t grab a newer version
Database version: Postgres 8.4rc1

Stacktrace when running 2.0-rc2 for the first time on a database that previously used 1.9.5
liquibase.exception.ValidationFailedException: Validation Failed:
    1 change sets check sum
         liquibase/2009-12-28-cc4345-convert-ids-to-int8.xml::1::jmccabe::(Checksum: 2:d41d8cd98f00b204e9800998ecf8427e)
    7 changes have validation errors
         liquibase.exception.UnexpectedLiquibaseException: Type class liquibase.database.structure.type.ClobType doesn’t support precision but precision was specified
         liquibase.exception.UnexpectedLiquibaseException: Type class liquibase.database.structure.type.ClobType doesn’t support precision but precision was specified
         liquibase.exception.UnexpectedLiquibaseException: Type class liquibase.database.structure.type.ClobType doesn’t support precision but precision was specified
         liquibase.exception.UnexpectedLiquibaseException: Type class liquibase.database.structure.type.ClobType doesn’t support precision but precision was specified
         liquibase.exception.UnexpectedLiquibaseException: Type class liquibase.database.structure.type.ClobType doesn’t support precision but precision was specified
         liquibase.exception.UnexpectedLiquibaseException: Type class liquibase.database.structure.type.ClobType doesn’t support precision but precision was specified
         liquibase.exception.UnexpectedLiquibaseException: Type class liquibase.database.structure.type.ClobType doesn’t support precision but precision was specified

       at liquibase.changelog.DatabaseChangeLog.validate(DatabaseChangeLog.java:132)
       at liquibase.Liquibase.update(Liquibase.java:98)
       at liquibase.integration.ant.DatabaseUpdateTask.execute(DatabaseUpdateTask.java:45)
       at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)

Changelog file mentioned above:
First the 2.0-rc2 version, replaced with

<?xml version="1.0" encoding="UTF-8" standalone="no"?>

<databaseChangeLog xmlns=“http://www.liquibase.org/xml/ns/dbchangelog”
                  xmlns:xsi=“http://www.w3.org/2001/XMLSchema-instance”
                  xsi:schemaLocation=“http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-2.0.xsd”>

   
       
       
       

       
       
       

       
       
       

       
       
       

       
           
           
           

           
           
           

           
           
           

           
           
           
       
   

Here’s the original 1.9.5 version:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>

<databaseChangeLog xmlns=“http://www.liquibase.org/xml/ns/dbchangelog/1.9”
                  xmlns:xsi=“http://www.w3.org/2001/XMLSchema-instance”
                  xsi:schemaLocation=“http://www.liquibase.org/xml/ns/dbchangelog/1.9 http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-1.9.xsd”>

   
       
           
           
           
       
       
           
           
           
       
       
           
           
           
       
       
           
           
           
       

       
           
               
               
               
           
           
               
               
               
           
           
               
               
               
           
           
               
               
               
           
       
   

Aha!  I found the problem!  Ignore most of the details in my previous post since the Liquibase error message was a bit of a red herring since the file it complained about was fine. 

Looks like a bug with generateChangeLog either in 1.9.5 or in the change from 1.9.5 to 2.0.

I just reran generateChangeLog in 1.9.5 against a table with the following DDL:
CREATE TABLE etl_end
    (
        id INTEGER DEFAULT nextval(‘etl_end_id_seq’::regclass) NOT NULL,
        event_time TIMESTAMP(6) WITH TIME ZONE NOT NULL,
        host TEXT NOT NULL,
        instance TEXT NOT NULL,
        run_id BIGINT,
        module TEXT,
        success BOOLEAN,
        message TEXT,
        PRIMARY KEY(id)
    )

Here’s the result (notice the numbers in parentheses after TEXT):



















Compare that with generateChangeLog in 2.0-rc2 (notice it’s just TEXT):



















According to http://www.postgresql.org/docs/8.0/interactive/datatype-character.html 2.0-rc2 is doing the correct thing by not specifying a length.  Unfortunately 2.0-rc2 errors out when attempting to validate a 1.9.5 generated change log.

Not sure exactly what to do in this situation.  My current plan is to generate a new baseline file, comment out or remove previous changes, and go from there.

Martin

Yes, the precision on the text columns was a bug in RC1.  What errors are you seeing validating a 1.9 changelog?  The goal is to make them as compatible as possible.

Nathan