Skip to content

Instantly share code, notes, and snippets.

@razum2um
Created September 13, 2011 21:22
Show Gist options
  • Save razum2um/1215212 to your computer and use it in GitHub Desktop.
Save razum2um/1215212 to your computer and use it in GitHub Desktop.
diff --git a/django/db/backends/postgresql_psycopg2/creation.py b/django/db/backends/postgresql_psycopg2/creation.py
index 1f5609a..4468062 100644
--- a/django/db/backends/postgresql_psycopg2/creation.py
+++ b/django/db/backends/postgresql_psycopg2/creation.py
@@ -34,9 +34,12 @@ class DatabaseCreation(BaseDatabaseCreation):
def sql_table_creation_suffix(self):
assert self.connection.settings_dict['TEST_COLLATION'] is None, "PostgreSQL does not support collation setting at database creation time."
+ suffix = ''
+ if self.connection.settings_dict.get('TEST_TABLESPACE'):
+ suffix += " WITH TABLESPACE = %s " % self.connection.settings_dict['TEST_TABLESPACE']
if self.connection.settings_dict['TEST_CHARSET']:
- return "WITH ENCODING '%s'" % self.connection.settings_dict['TEST_CHARSET']
- return ''
+ suffix += " WITH ENCODING '%s' " % self.connection.settings_dict['TEST_CHARSET']
+ return suffix
def sql_indexes_for_field(self, model, f, style):
if f.db_index and not f.unique:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment