Problem getting IndexExists preCondition to work

I am trying to use the “indexExists” precondition tag before dropping an index, and it’s not working - liquibase is always reporting the index does not exist, even though it is present. This causes later changesets to fail because the index was not dropped.


I have used version 1.9.5 of Liquibase. Any suggestion what to do differently or how to debug?

may be


    to debug your statements are executed, use liquibase updateSQL instead of liquibase update

    Cheers, Oleg

    Thanks for the suggestions, but as I am using version 1.9.5:
    1: indexExists does not accept “tableName” attribute
    2: updateSQL() is not a method in class Liquibase that I see

    I just mean commad updateSQL as described in manual. see

    To produce it programatically use

      liquibase.update(contexts, getOutputWriter());
    generated sql snippets do not send to the server but are wrapping into the output stream. see $LB_SRC_195\core\src\java\liquibase\commandline\

    The problem seems to be related to liquibase not recognizing Foreign Key indexes, e.g. the index that I am checking in my is a foreign key index, but liquibase incorrectly determines that the index does not exist.

    Looking at, it appears that the readIndexes() method is explicitly removing Primary Key indexes, Foreign Key indexes, and Unique Constraint indexes from the set of indexes. Why? This looks to be the reason that is failing.