private static void installPgCatalog(Statement stat) throws SQLException {
Reader r = null;
try {
r = new InputStreamReader(new ByteArrayInputStream(Utils.getResource("/org/lealone/res/pg_catalog.sql")));
ScriptReader reader = new ScriptReader(r);
while (true) {
String sql = reader.readStatement();
if (sql == null) {
break;
}
stat.execute(sql);
}
reader.close();
} catch (IOException e) {
throw DbException.convertIOException(e, "Can not read pg_catalog resource");
} finally {
IOUtils.closeSilently(r);
}