From 7b119c1c77c8e0d17b55088f83a1552c73ceb31c Mon Sep 17 00:00:00 2001 From: Thomas Schreiber Date: Tue, 31 Dec 2013 03:31:21 +0100 Subject: [PATCH] only attempt to create the postgis extension when it does not already exist --- django/contrib/gis/db/backends/postgis/creation.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/django/contrib/gis/db/backends/postgis/creation.py b/django/contrib/gis/db/backends/postgis/creation.py index 4f64ecce29..51ac197b8e 100644 --- a/django/contrib/gis/db/backends/postgis/creation.py +++ b/django/contrib/gis/db/backends/postgis/creation.py @@ -89,7 +89,7 @@ class PostGISCreation(DatabaseCreation): self.connection.close() self.connection.settings_dict["NAME"] = test_database_name cursor = self.connection.cursor() - cursor.execute("CREATE EXTENSION postgis") + cursor.execute("CREATE EXTENSION IF NOT EXISTS postgis") cursor.connection.commit() return test_database_name