Browse Source

fix(postgres): end transaction before DDL

closes https://github.com/frappe/frappe/issues/17210
version-14
Ankush Menat 2 years ago
parent
commit
5d2aedc698
1 changed files with 1 additions and 0 deletions
  1. +1
    -0
      frappe/database/postgres/setup_db.py

+ 1
- 0
frappe/database/postgres/setup_db.py View File

@@ -116,5 +116,6 @@ def drop_user_and_database(db_name, root_login, root_password):
"SELECT pg_terminate_backend (pg_stat_activity.pid) FROM pg_stat_activity WHERE pg_stat_activity.datname = %s",
(db_name,),
)
root_conn.sql("end")
root_conn.sql(f"DROP DATABASE IF EXISTS {db_name}")
root_conn.sql(f"DROP USER IF EXISTS {db_name}")

Loading…
Cancel
Save