Problem with generateChangeLog for existing database

Hi,


New to liquibase as of today. Trying to test some changes by first getting a copy of our existing database schema into liquibase. I ran the following command:


liquibase --driver=org.postgresql.Driver </div>

      --changeLogFile=db.changelog.xml </div>

      --classpath=postgresql-9.1-901.jdbc4.jar </div>

      --url=“jdbc:postgresql://dev01:5432/ampamw” </div>

      --username=inpoc </div>

      --password=password </div>

      generateChangeLog


against a postgresql 8.4 instance. The result looked like:


Liquibase Home is not set.

Liquibase Home: /Users/jeffwilliams/dev/liquibase/liquibase

INFO 4/2/12 2:10 PM:liquibase: Reading tables for inpoc @ jdbc:postgresql://dev01:5432/ampamw …

INFO 4/2/12 2:10 PM:liquibase: Reading views for inpoc @ jdbc:postgresql://dev01:5432/ampamw …

INFO 4/2/12 2:10 PM:liquibase: Reading foreign keys for inpoc @ jdbc:postgresql://dev01:5432/ampamw …

WARNING 4/2/12 2:11 PM:liquibase: Foreign key fk9ebfecd361bbc6d0 references table amw_stat_report_key, which is in a different schema. Retaining FK in diff, but table will not be diffed.

WARNING 4/2/12 2:11 PM:liquibase: Foreign key amw_presale_user_fk1 references table amw_presale_secret_key, which is in a different schema. Retaining FK in diff, but table will not be diffed.

WARNING 4/2/12 2:11 PM:liquibase: Foreign key fk41eeff742c60edf0 references table amw_presale_secret_key, which is in a different schema. Retaining FK in diff, but table will not be diffed.

INFO 4/2/12 2:11 PM:liquibase: Reading primary keys for inpoc @ jdbc:postgresql://dev01:5432/ampamw …

INFO 4/2/12 2:11 PM:liquibase: Reading columns for inpoc @ jdbc:postgresql://dev01:5432/ampamw …

Liquibase Update Failed: ERROR: syntax error at or near “column”

  Position: 9

SEVERE 4/2/12 2:11 PM:liquibase: ERROR: syntax error at or near “column”

  Position: 9

liquibase.exception.DatabaseException: org.postgresql.util.PSQLException: ERROR: syntax error at or near “column”

  Position: 9

… 5 more


Regards,

Jeff

It looks like it is getting caught up on a column or table named “column”. Do you know where that may be and if it would be easy to rename as a workaround?

Nathan

Ok, I’ve found what may be the cause:

  1. # \d tmp_rule_type_group
  2. Table “public.tmp_rule_type_group”
  3.   Column  |  Type   | Modifiers 
  4. ----------±--------±----------
  5.  ruleid   | integer | 
  6.  ?column? | text    | 

However, shouldn’t liquibase be able to handle strange column names that are accepted by the database? Or is there an easy way to exclude this table from the dump? Getting a rename may take a long time.


Jeff