liquibase: ERROR: syntax error at or near "order"

Hi,
I’m getting the following error during diff on Postgres databases. There are few tables containing column named “order”, not sure if that’s causing this exception.

Thanks for your help!

./liquibase --driver=org.postgresql.Driver   --defaultSchemaName=testdb   --url=jdbc:postgresql://host1/testdb  --username=testdb  diff   --referenceUrl=jdbc:postgresql://app9/testdb      --referenceUsername=testdb_dev
Liquibase Home: /home/user1/liquibase

Liquibase Update Failed: ERROR: syntax error at or near “order”
  Position: 8
SEVERE 10/8/11 8:28 PM:liquibase: ERROR: syntax error at or near “order”
  Position: 8
liquibase.exception.DatabaseException: org.postgresql.util.PSQLException: ERROR: syntax error at or near “order”
  Position: 8
        at liquibase.snapshot.jvm.JdbcDatabaseSnapshotGenerator.createSnapshot(JdbcDatabaseSnapshotGenerator.java:251)
        at liquibase.snapshot.DatabaseSnapshotGeneratorFactory.createSnapshot(DatabaseSnapshotGeneratorFactory.java:69)
        at liquibase.diff.Diff.compare(Diff.java:63)
        at liquibase.integration.commandline.CommandLineUtils.doDiff(CommandLineUtils.java:118)
        at liquibase.integration.commandline.Main.doMigration(Main.java:713)
        at liquibase.integration.commandline.Main.main(Main.java:133)
Caused by: org.postgresql.util.PSQLException: ERROR: syntax error at or near “order”
  Position: 8
        at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2103)
        at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1836)
        at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:257)
        at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:512)
        at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:374)
        at org.postgresql.jdbc2.AbstractJdbc2Statement.executeQuery(AbstractJdbc2Statement.java:254)
        at liquibase.snapshot.jvm.JdbcDatabaseSnapshotGenerator.isColumnAutoIncrement(JdbcDatabaseSnapshotGenerator.java:842)
        at liquibase.snapshot.jvm.JdbcDatabaseSnapshotGenerator.readColumns(JdbcDatabaseSnapshotGenerator.java:369)
        at liquibase.snapshot.jvm.JdbcDatabaseSnapshotGenerator.createSnapshot(JdbcDatabaseSnapshotGenerator.java:244)
        … 5 more

Yes, that probably is the problem. I can add “order” as a reserved word for postgres, but if you need it earlier, you may need to subclass PostgresDatabase yourself and add it as an extension (liquibase.org/extensions)

Nathan