From bdecf9bbd1b4500552bb2ac3abcb5b9a6c907484 Mon Sep 17 00:00:00 2001 From: Peter Hormanns Date: Fri, 8 Apr 2016 13:00:05 +0200 Subject: [PATCH] try perform instead of select --- .../src/de/hsadmin/mods/db/PgSqlDatabaseProcessorFactory.java | 2 +- hsarback/src/de/hsadmin/mods/db/PgSqlUserProcessorFactory.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hsarback/src/de/hsadmin/mods/db/PgSqlDatabaseProcessorFactory.java b/hsarback/src/de/hsadmin/mods/db/PgSqlDatabaseProcessorFactory.java index a4a650f..313bb4c 100644 --- a/hsarback/src/de/hsadmin/mods/db/PgSqlDatabaseProcessorFactory.java +++ b/hsarback/src/de/hsadmin/mods/db/PgSqlDatabaseProcessorFactory.java @@ -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("SELECT pg_terminate_backend(pid) FROM pg_stat_activity WHERE datname='" + aName + "'"); + aJDBCP.addSQL("PERFORM pg_terminate_backend(pid) FROM pg_stat_activity WHERE datname='" + aName + "'"); aJDBCP.addSQL("DROP DATABASE " + aName); return aJDBCP; } diff --git a/hsarback/src/de/hsadmin/mods/db/PgSqlUserProcessorFactory.java b/hsarback/src/de/hsadmin/mods/db/PgSqlUserProcessorFactory.java index a27715f..f2c9983 100644 --- a/hsarback/src/de/hsadmin/mods/db/PgSqlUserProcessorFactory.java +++ b/hsarback/src/de/hsadmin/mods/db/PgSqlUserProcessorFactory.java @@ -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("SELECT pg_terminate_backend(pid) FROM pg_stat_activity WHERE usename='" + aName + "'"); + aJDBCP.addSQL("PERFORM pg_terminate_backend(pid) FROM pg_stat_activity WHERE usename='" + aName + "'"); aJDBCP.addSQL("DROP USER " + aName); return aJDBCP; }