summaryrefslogtreecommitdiff
path: root/django/db/backends/postgresql/creation.py
diff options
context:
space:
mode:
Diffstat (limited to 'django/db/backends/postgresql/creation.py')
-rw-r--r--django/db/backends/postgresql/creation.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/django/db/backends/postgresql/creation.py b/django/db/backends/postgresql/creation.py
index 9b562cec18..938be0f56f 100644
--- a/django/db/backends/postgresql/creation.py
+++ b/django/db/backends/postgresql/creation.py
@@ -58,6 +58,7 @@ class DatabaseCreation(BaseDatabaseCreation):
# CREATE DATABASE ... WITH TEMPLATE ... requires closing connections
# to the template database.
self.connection.close()
+ self.connection.close_pool()
source_database_name = self.connection.settings_dict["NAME"]
target_database_name = self.get_test_db_clone_settings(suffix)["NAME"]
@@ -84,3 +85,7 @@ class DatabaseCreation(BaseDatabaseCreation):
except Exception as e:
self.log("Got an error cloning the test database: %s" % e)
sys.exit(2)
+
+ def _destroy_test_db(self, test_database_name, verbosity):
+ self.connection.close_pool()
+ return super()._destroy_test_db(test_database_name, verbosity)