}
@Override
protected Connection newConnection() throws SQLException {
final Connection connection = getConnectionFactory().newConnection();
final PGConnection pgConnection;
if ( connection instanceof PGConnection ) {
pgConnection = (PGConnection) connection;
}
else {
pgConnection = connection.unwrap(PGConnection.class);
}
pgConnection.addDataType("daterange", DateRangeType.class);
pgConnection.addDataType("tsrange", TsRangeType.class);
pgConnection.addDataType("tstzrange", TstzRangeType.class);
pgConnection.addDataType("int4range", Int4RangeType.class);
pgConnection.addDataType("int8range", Int8RangeType.class);
pgConnection.addDataType("numrange", NumRangeType.class);
return connection;
}