Changeset 4573
- Timestamp:
- 02/25/07 10:18:46 (2 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/trunk/django/db/backends/postgresql/base.py
r4265 r4573 61 61 def cursor(self): 62 62 from django.conf import settings 63 set_tz = False 63 64 if self.connection is None: 65 set_tz = True 64 66 if settings.DATABASE_NAME == '': 65 67 from django.core.exceptions import ImproperlyConfigured … … 77 79 self.connection.set_isolation_level(1) # make transactions transparent to all cursors 78 80 cursor = self.connection.cursor() 79 cursor.execute("SET TIME ZONE %s", [settings.TIME_ZONE]) 81 if set_tz: 82 cursor.execute("SET TIME ZONE %s", [settings.TIME_ZONE]) 80 83 cursor = UnicodeCursorWrapper(cursor, settings.DEFAULT_CHARSET) 81 84 if settings.DEBUG: django/trunk/django/db/backends/postgresql_psycopg2/base.py
r4265 r4573 29 29 def cursor(self): 30 30 from django.conf import settings 31 set_tz = False 31 32 if self.connection is None: 33 set_tz = True 32 34 if settings.DATABASE_NAME == '': 33 35 from django.core.exceptions import ImproperlyConfigured … … 46 48 cursor = self.connection.cursor() 47 49 cursor.tzinfo_factory = None 48 cursor.execute("SET TIME ZONE %s", [settings.TIME_ZONE]) 50 if set_tz: 51 cursor.execute("SET TIME ZONE %s", [settings.TIME_ZONE]) 49 52 if settings.DEBUG: 50 53 return util.CursorDebugWrapper(cursor, self)
