=== modified file 'django/conf/project_template/settings.py'
|
|
|
11 | 11 | |
12 | 12 | DATABASE_ENGINE = '' # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'ado_mssql'. |
13 | 13 | DATABASE_NAME = '' # Or path to database file if using sqlite3. |
| 14 | DATABASE_SCHEMAS = '' # Only used with postgresq to support multiple schemas |
14 | 15 | DATABASE_USER = '' # Not used with sqlite3. |
15 | 16 | DATABASE_PASSWORD = '' # Not used with sqlite3. |
16 | 17 | DATABASE_HOST = '' # Set to empty string for localhost. Not used with sqlite3. |
=== modified file 'django/db/backends/postgresql/base.py'
|
|
|
83 | 83 | cursor = self.connection.cursor() |
84 | 84 | if set_tz: |
85 | 85 | cursor.execute("SET TIME ZONE %s", [settings.TIME_ZONE]) |
| 86 | if settings.DATABASE_SCHEMAS: |
| 87 | cursor.execute("SET search_path TO %s;" % settings.DATABASE_SCHEMAS) |
86 | 88 | cursor = UnicodeCursorWrapper(cursor, settings.DEFAULT_CHARSET) |
87 | 89 | global postgres_version |
88 | 90 | if not postgres_version: |
=== modified file 'django/db/backends/postgresql_psycopg2/base.py'
|
|
|
52 | 52 | cursor.tzinfo_factory = None |
53 | 53 | if set_tz: |
54 | 54 | cursor.execute("SET TIME ZONE %s", [settings.TIME_ZONE]) |
| 55 | if settings.DATABASE_SCHEMAS: |
| 56 | cursor.execute("SET search_path TO %s;" % settings.DATABASE_SCHEMAS) |
55 | 57 | global postgres_version |
56 | 58 | if not postgres_version: |
57 | 59 | cursor.execute("SELECT version()") |
=== modified file 'docs/settings.txt'
|
|
|
302 | 302 | |
303 | 303 | The username to use when connecting to the database. Not used with SQLite. |
304 | 304 | |
| 305 | DATABASE_SCHEMAS |
| 306 | ---------------- |
| 307 | |
| 308 | Default: ``''`` (Empty string) |
| 309 | |
| 310 | On databases supporting Schemas, like PostgreSQL, the search_path will be |
| 311 | set to the value of this setting which is, by default, ``public``. |
| 312 | |
| 313 | Please, note that currently the only backend which schema support is PostgreSQL. |
| 314 | |
305 | 315 | DATE_FORMAT |
306 | 316 | ----------- |
307 | 317 | |