}
// We need to see if we have the citext extension and if we are authorized to
// create it, to make things easy, we just directly try to do so, if this fails,
// the test will be skipped
JDBCTestSetup setup = createTestSetup();
setup.setFixture(fixture);
Connection cx = null;
Statement st = null;
try {
DataSource dataSource = setup.getDataSource();
cx = dataSource.getConnection();
st = cx.createStatement();
// check if the extension exists, and creates it in the database if needed
st.execute("create extension if not exists citext");
st.close();
cx.close();
return true;
}
catch (Throwable t) {
return false;
}
finally {
if (st != null) {
st.close();
}
if (cx != null) {
cx.close();
}
try {
setup.tearDown();
}
catch(Exception e) {
System.out.println("Error occurred tearing down the test setup");
}
}