Use lowercase schema name if db is postgres. Hold the schemaname in TaskanaEngineConfiguration in lower case...
This commit is contained in:
parent
70c715239b
commit
efc121257d
|
@ -5,6 +5,7 @@ import java.io.FileInputStream;
|
|||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.sql.Connection;
|
||||
import java.sql.SQLException;
|
||||
import java.time.Duration;
|
||||
import java.time.Instant;
|
||||
|
@ -282,6 +283,17 @@ public class TaskanaEngineConfiguration {
|
|||
this.setSchemaName(DEFAULT_SCHEMA_NAME);
|
||||
}
|
||||
|
||||
try (Connection connection = dataSource.getConnection()) {
|
||||
String databaseProductName = connection.getMetaData().getDatabaseProductName();
|
||||
if (TaskanaEngineImpl.isPostgreSQL(databaseProductName)) {
|
||||
this.schemaName = this.schemaName.toLowerCase();
|
||||
} else {
|
||||
this.schemaName = this.schemaName.toUpperCase();
|
||||
}
|
||||
} catch (SQLException ex) {
|
||||
LOGGER.error("Caught {} when attempting to initialize the schema name", ex);
|
||||
}
|
||||
|
||||
LOGGER.debug("Using schema name {}", this.getSchemaName());
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue