Hi,
I would like to execute dropAll on our RedShift DB, and I get this strange error. Unfortunatelly I don't even see from the debug output what SQL statement is causeing the problem (see below). On one line it states "Successfully released change log lock", on the next line: "Liquibase dropAll Failed: liquibase.exception.UnexpectedLiquibaseException: liquibase.exception.DatabaseException: liquibase.exception.DatabaseException: org.postgresql.util.PSQLException: Unable to determine a value for MaxIndexKeys due to missing system catalog data."
here's the debug output:
$ liquibase --defaultsFile=redshift.properties --logLevel=debug dropAll
DEBUG 2/10/14 3:05 PM:liquibase: Connected to innotest@jdbc:postgresql://idan-rf-test.cthrquit7zzo.us-east-1.redshift.amazonaws.com:5439/gavriel_systemtest
DEBUG 2/10/14 3:05 PM:liquibase: Setting auto commit to false from true
DEBUG 2/10/14 3:05 PM:liquibase: Executing QUERY database command: select count(*) from public.databasechangeloglock
DEBUG 2/10/14 3:05 PM:liquibase: Executing QUERY database command: SELECT LOCKED FROM public.databasechangeloglock WHERE ID=1
DEBUG 2/10/14 3:05 PM:liquibase: Lock Database
DEBUG 2/10/14 3:05 PM:liquibase: Executing UPDATE database command: UPDATE public.databasechangeloglock SET LOCKED = TRUE, LOCKEDBY = 'galaxy (fe80:0:0:0:800:27ff:fe00:0%4)', LOCKGRANTED = '2014-02-10 15:05:16.282' WHERE ID = 1 AND LOCKED = FALSE
INFO 2/10/14 3:05 PM:liquibase: Successfully acquired change log lock
INFO 2/10/14 3:05 PM:liquibase: Dropping Database Objects in schema: gavriel_systemtest.public
DEBUG 2/10/14 3:05 PM:liquibase: Executing QUERY database command: SELECT MD5SUM FROM public.databasechangelog WHERE MD5SUM IS NOT NULL
DEBUG 2/10/14 3:05 PM:liquibase: Executing QUERY database command: select count(*) from public.databasechangeloglock
DEBUG 2/10/14 3:05 PM:liquibase: Executing QUERY database command: SELECT relname AS SEQUENCE_NAME FROM pg_class, pg_namespace WHERE relkind='S' AND pg_class.relnamespace = pg_namespace.oid AND nspname = 'public' AND 'nextval(''public.'||relname||'''::regclass)' not in (select adsrc from pg_attrdef where adsrc is not null) AND 'nextval(''public."'||relname||'"''::regclass)' not in (select adsrc from pg_attrdef where adsrc is not null) AND 'nextval('''||relname||'''::regclass)' not in (select adsrc from pg_attrdef where adsrc is not null)AND 'nextval(''"'||relname||'"''::regclass)' not in (select adsrc from pg_attrdef where adsrc is not null)
DEBUG 2/10/14 3:05 PM:liquibase: Release Database Lock
DEBUG 2/10/14 3:05 PM:liquibase: Executing UPDATE database command: UPDATE public.databasechangeloglock SET LOCKED = FALSE, LOCKEDBY = NULL, LOCKGRANTED = NULL WHERE ID = 1
INFO 2/10/14 3:05 PM:liquibase: Successfully released change log lock
Liquibase dropAll Failed: liquibase.exception.UnexpectedLiquibaseException: liquibase.exception.DatabaseException: liquibase.exception.DatabaseException: org.postgresql.util.PSQLException: Unable to determine a value for MaxIndexKeys due to missing system catalog data.
SEVERE 2/10/14 3:05 PM:liquibase: liquibase.exception.UnexpectedLiquibaseException: liquibase.exception.DatabaseException: liquibase.exception.DatabaseException: org.postgresql.util.PSQLException: Unable to determine a value for MaxIndexKeys due to missing system catalog data.
liquibase.exception.DatabaseException: liquibase.exception.UnexpectedLiquibaseException: liquibase.exception.DatabaseException: liquibase.exception.DatabaseException: org.postgresql.util.PSQLException: Unable to determine a value for MaxIndexKeys due to missing system catalog data.
at liquibase.Liquibase.dropAll(Liquibase.java:685)
at liquibase.Liquibase.dropAll(Liquibase.java:665)
at liquibase.integration.commandline.Main.doMigration(Main.java:831)
at liquibase.integration.commandline.Main.main(Main.java:133)
Caused by: liquibase.exception.UnexpectedLiquibaseException: liquibase.exception.DatabaseException: liquibase.exception.DatabaseException: org.postgresql.util.PSQLException: Unable to determine a value for MaxIndexKeys due to missing system catalog data.
at liquibase.database.AbstractJdbcDatabase.dropDatabaseObjects(AbstractJdbcDatabase.java:719)
at liquibase.Liquibase.dropAll(Liquibase.java:678)
... 3 more
Caused by: liquibase.exception.DatabaseException: liquibase.exception.DatabaseException: org.postgresql.util.PSQLException: Unable to determine a value for MaxIndexKeys due to missing system catalog data.
at liquibase.snapshot.jvm.ForeignKeySnapshotGenerator.addTo(ForeignKeySnapshotGenerator.java:86)
at liquibase.snapshot.jvm.JdbcSnapshotGenerator.snapshot(JdbcSnapshotGenerator.java:72)
at liquibase.snapshot.SnapshotGeneratorChain.snapshot(SnapshotGeneratorChain.java:47)
at liquibase.snapshot.jvm.JdbcSnapshotGenerator.snapshot(JdbcSnapshotGenerator.java:62)
at liquibase.snapshot.SnapshotGeneratorChain.snapshot(SnapshotGeneratorChain.java:47)
at liquibase.snapshot.jvm.JdbcSnapshotGenerator.snapshot(JdbcSnapshotGenerator.java:62)
at liquibase.snapshot.SnapshotGeneratorChain.snapshot(SnapshotGeneratorChain.java:47)
at liquibase.snapshot.DatabaseSnapshot.include(DatabaseSnapshot.java:131)
at liquibase.snapshot.DatabaseSnapshot.replaceObject(DatabaseSnapshot.java:199)
at liquibase.snapshot.DatabaseSnapshot.replaceObject(DatabaseSnapshot.java:212)
at liquibase.snapshot.DatabaseSnapshot.includeNestedObjects(DatabaseSnapshot.java:158)
at liquibase.snapshot.DatabaseSnapshot.include(DatabaseSnapshot.java:145)
at liquibase.snapshot.DatabaseSnapshot.<init>(DatabaseSnapshot.java:36)
at liquibase.snapshot.JdbcDatabaseSnapshot.<init>(JdbcDatabaseSnapshot.java:24)
at liquibase.snapshot.SnapshotGeneratorFactory.createSnapshot(SnapshotGeneratorFactory.java:129)
at liquibase.snapshot.SnapshotGeneratorFactory.createSnapshot(SnapshotGeneratorFactory.java:122)
at liquibase.snapshot.SnapshotGeneratorFactory.createSnapshot(SnapshotGeneratorFactory.java:110)
at liquibase.database.AbstractJdbcDatabase.dropDatabaseObjects(AbstractJdbcDatabase.java:716)
... 4 more
Caused by: liquibase.exception.DatabaseException: org.postgresql.util.PSQLException: Unable to determine a value for MaxIndexKeys due to missing system catalog data.
at liquibase.snapshot.ResultSetCache.get(ResultSetCache.java:73)
at liquibase.snapshot.JdbcDatabaseSnapshot$CachingDatabaseMetaData.getForeignKeys(JdbcDatabaseSnapshot.java:57)
at liquibase.snapshot.jvm.ForeignKeySnapshotGenerator.addTo(ForeignKeySnapshotGenerator.java:75)
... 21 more
Caused by: org.postgresql.util.PSQLException: Unable to determine a value for MaxIndexKeys due to missing system catalog data.
at org.postgresql.jdbc2.AbstractJdbc2DatabaseMetaData.getMaxIndexKeys(AbstractJdbc2DatabaseMetaData.java:64)
at org.postgresql.jdbc2.AbstractJdbc2DatabaseMetaData.getImportedExportedKeys(AbstractJdbc2DatabaseMetaData.java:3187)
at org.postgresql.jdbc2.AbstractJdbc2DatabaseMetaData.getImportedKeys(AbstractJdbc2DatabaseMetaData.java:3517)
at liquibase.snapshot.JdbcDatabaseSnapshot$CachingDatabaseMetaData$1.fastFetch(JdbcDatabaseSnapshot.java:89)
at liquibase.snapshot.ResultSetCache.get(ResultSetCache.java:51)
... 23 more
For more information, use the --logLevel flag