perform does not work

This commit is contained in:
Peter Hormanns 2016-04-08 13:37:41 +02:00
parent bdecf9bbd1
commit dd4ce59112
2 changed files with 2 additions and 2 deletions

View File

@ -46,7 +46,7 @@ public class PgSqlDatabaseProcessorFactory implements EntityProcessorFactory {
assert db.getInstance().equals("pgsql");
JDBCProcessor aJDBCP = createPostgreSqlAdminProcessor();
String aName = AbstractEntity.escapeString(db.getName());
aJDBCP.addSQL("PERFORM pg_terminate_backend(pid) FROM pg_stat_activity WHERE datname='" + aName + "'");
aJDBCP.addSQL("SELECT pg_terminate_backend(pid) FROM pg_stat_activity WHERE datname='" + aName + "'");
aJDBCP.addSQL("DROP DATABASE " + aName);
return aJDBCP;
}

View File

@ -41,7 +41,7 @@ public class PgSqlUserProcessorFactory implements EntityProcessorFactory {
assert dbu.getInstance().equals("pgsql");
JDBCProcessor aJDBCP = PgSqlDatabaseProcessorFactory.createPostgreSqlAdminProcessor();
String aName = AbstractEntity.escapeString(dbu.getName());
aJDBCP.addSQL("PERFORM pg_terminate_backend(pid) FROM pg_stat_activity WHERE usename='" + aName + "'");
aJDBCP.addSQL("SELECT pg_terminate_backend(pid) FROM pg_stat_activity WHERE usename='" + aName + "'");
aJDBCP.addSQL("DROP USER " + aName);
return aJDBCP;
}