Ticket #1051: django_pgsql_schemas_rev4201.patch
File django_pgsql_schemas_rev4201.patch, 2.0 KB (added by , 18 years ago) |
---|
-
django/conf/project_template/settings.py
11 11 12 12 DATABASE_ENGINE = '' # '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. -
django/db/backends/postgresql/base.py
45 45 self.connection.set_isolation_level(1) # make transactions transparent to all cursors 46 46 cursor = self.connection.cursor() 47 47 cursor.execute("SET TIME ZONE %s", [settings.TIME_ZONE]) 48 if settings.DATABASE_SCHEMAS: 49 cursor.execute("SET search_path TO %s;" % settings.DATABASE_SCHEMAS) 48 50 if settings.DEBUG: 49 51 return util.CursorDebugWrapper(cursor, self) 50 52 return cursor -
django/db/backends/postgresql_psycopg2/base.py
46 46 cursor = self.connection.cursor() 47 47 cursor.tzinfo_factory = None 48 48 cursor.execute("SET TIME ZONE %s", [settings.TIME_ZONE]) 49 if settings.DATABASE_SCHEMAS: 50 cursor.execute("SET search_path TO %s;" % settings.DATABASE_SCHEMAS) 49 51 if settings.DEBUG: 50 52 return util.CursorDebugWrapper(cursor, self) 51 53 return cursor