mirror of https://github.com/apache/druid.git
Fix postgres metadata storage warning logs because of tablename causing issues (#17351)
This commit is contained in:
parent
450fb0147b
commit
8c52be81d3
|
@ -42,6 +42,7 @@ import java.sql.DatabaseMetaData;
|
|||
import java.sql.SQLException;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Set;
|
||||
|
||||
public class PostgreSQLConnector extends SQLMetadataConnector
|
||||
{
|
||||
|
@ -287,4 +288,24 @@ public class PostgreSQLConnector extends SQLMetadataConnector
|
|||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method has been overridden to pass lowercase tableName.
|
||||
* This is done because PostgreSQL creates tables with lowercased names unless explicitly enclosed in double quotes.
|
||||
*/
|
||||
@Override
|
||||
protected boolean tableHasColumn(String tableName, String columnName)
|
||||
{
|
||||
return super.tableHasColumn(StringUtils.toLowerCase(tableName), columnName);
|
||||
}
|
||||
|
||||
/**
|
||||
* This method has been overridden to pass lowercase tableName.
|
||||
* This is done because PostgreSQL creates tables with lowercased names unless explicitly enclosed in double quotes.
|
||||
*/
|
||||
@Override
|
||||
public Set<String> getIndexOnTable(String tableName)
|
||||
{
|
||||
return super.getIndexOnTable(StringUtils.toLowerCase(tableName));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue