Ticket #12308: postgres_tablespace_support.diff

File postgres_tablespace_support.diff, 854 bytes (added by Travis Cline <travis.cline@…>, 6 years ago)
  • django/db/backends/postgresql/creation.py

    diff --git a/django/db/backends/postgresql/creation.py b/django/db/backends/postgresql/creation.py
    index 8f329fe..f1102ed 100644
    a b class DatabaseCreation(BaseDatabaseCreation): 
    3131
    3232    def sql_table_creation_suffix(self):
    3333        assert settings.TEST_DATABASE_COLLATION is None, "PostgreSQL does not support collation setting at database creation time."
     34        result = []
    3435        if settings.TEST_DATABASE_CHARSET:
    35             return "WITH ENCODING '%s'" % settings.TEST_DATABASE_CHARSET
    36         return ''
     36            result.append("WITH ENCODING '%s'" % settings.TEST_DATABASE_CHARSET)
     37        if settings.DEFAULT_TABLESPACE:
     38            result.append("TABLESPACE %s" % settings.DEFAULT_TABLESPACE)
     39        return ' '.join(result)
Back to Top