summaryrefslogtreecommitdiff
path: root/django/db/backends/postgresql/creation.py
diff options
context:
space:
mode:
authorSarah Boyce <42296566+sarahboyce@users.noreply.github.com>2023-12-11 11:37:54 +0100
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2024-03-01 09:01:18 +0100
commitfad334e1a9b54ea1acb8cce02a25934c5acfe99f (patch)
tree4fc84e9981d6cdc83175d88eaa59c251cda009e7 /django/db/backends/postgresql/creation.py
parentbcccea3ef31c777b73cba41a6255cd866bf87237 (diff)
Refs #33497 -- Added connection pool support for PostgreSQL.
Co-authored-by: Florian Apolloner <florian@apolloner.eu> Co-authored-by: Ran Benita <ran@unusedvar.com>
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)