All i want is to execute the following SQL on my PostgreSQL server after my Hibernate SessionFactory has been initialized:
CREATE SCHEMA IF NOT EXISTS "fooschema" AUTHORIZATION "foouser";
Currently I am using the following routine:
Session s = factory.withOptions().openSession();
SQLQuery query = s.createSQLQuery(sql);
int res = query.executeUpdate();
// res is 0 and the schema has NOT been created
s.flush();
s.disconnect();
s.close();
The connected user has the permissions to chreate new schemata. So this is a simple question: What am i doing wrong?
Attachments:
Turning hibernate show_sql on prints the following:
Hibernate:
CREATE SCHEMA IF NOT EXISTS "fooschema" AUTHORIZATION "foouser";