Ignore case when testing for table existence

This commit is contained in:
Stéphane Derosiaux 2016-03-12 23:39:04 +01:00
parent cf7f6da392
commit 416cb03687
1 changed files with 1 additions and 1 deletions

View File

@ -72,7 +72,7 @@ public class PostgreSQLConnector extends SQLMetadataConnector
public boolean tableExists(final Handle handle, final String tableName) public boolean tableExists(final Handle handle, final String tableName)
{ {
return !handle.createQuery( return !handle.createQuery(
"SELECT tablename FROM pg_catalog.pg_tables WHERE schemaname = 'public' AND tablename LIKE :tableName" "SELECT tablename FROM pg_catalog.pg_tables WHERE schemaname = 'public' AND tablename ILIKE :tableName"
) )
.bind("tableName", tableName) .bind("tableName", tableName)
.map(StringMapper.FIRST) .map(StringMapper.FIRST)