Upgrade fails to remove index on PostgreSQL
When automatically upgrading database, the action (in UpgradeSessionBean) fails.
DROP INDEX <index_name> ON <table_name> syntax is wrong for PostgreSQL: ON <table_name> is not expected.
It does exist with MariaDB and MSSQL.
Just checked and it looks like the upgrade only prints an error here. So if you drop the index manually it is done. We're looking at how to improve this though. Thanks for the report.
In ejbca-common/src/org/ejbca/util/DatabaseIndexUtil.java, you have already have code to test product name:
if (databaseMetaData.getDatabaseProductName().equalsIgnoreCase(ORACLE) &&
databaseMetaData.getDatabaseMajorVersion() >= ORACLE_VERSION) {
I supposed it could be OK to define dropCrlDataIndex query string depending on ProductName value.
Thanks for finding that. We'll work on moving the drop index there and supporting more databases.
Fixed for EJBCA 8.3 in https://jira.primekey.se/browse/ECA-12323