diff --git a/django/contrib/gis/db/backend/postgis/management.py b/django/contrib/gis/db/backend/postgis/management.py index c1cb32a04f..3174c0229a 100644 --- a/django/contrib/gis/db/backend/postgis/management.py +++ b/django/contrib/gis/db/backend/postgis/management.py @@ -12,7 +12,8 @@ def _get_postgis_func(func): cursor = connection.cursor() cursor.execute('SELECT %s()' % func) row = cursor.fetchone() - cursor.close() + # Close out the connection. See #9437. + connection.close() return row[0] ### PostGIS management functions ###