From 5b0a1b9c76d10f79e082d465863eb74e8b01343b Mon Sep 17 00:00:00 2001 From: yalh76 Date: Mon, 25 Feb 2019 20:26:38 +0100 Subject: [PATCH] Fix remove step --- scripts/remove | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/remove b/scripts/remove index 62f94fe..fc4b6de 100644 --- a/scripts/remove +++ b/scripts/remove @@ -31,6 +31,8 @@ final_path=$(ynh_app_setting_get $app final_path) ynh_print_info "Removing the PostgreSQL database" # Remove a database if it exists, along with the associated user +ynh_psql_execute_as_root "\connect $db_name +SELECT pg_terminate_backend (pg_stat_activity.pid) FROM pg_stat_activity WHERE pg_stat_activity.datname = '$db_name';" ynh_psql_drop_db $db_name $db_name ynh_psql_drop_user $db_name