diff --git a/django/db/backends/postgresql_psycopg2/base.py b/django/db/backends/postgresql_psycopg2/base.py
index f0a89e5..75ebc3f 100644
a
|
b
|
class CursorWrapper(object):
|
38 | 38 | particular exception instances and reraise them with the right types. |
39 | 39 | """ |
40 | 40 | |
41 | | def __init__(self, cursor): |
| 41 | def __init__(self, cursor, settings_dict): |
42 | 42 | self.cursor = cursor |
| 43 | self.settings_dict = settings_dict |
43 | 44 | |
44 | 45 | def execute(self, query, args=None): |
45 | 46 | try: |
| 47 | self.cursor.execute("SET TIME ZONE %s", [self.settings_dict['TIME_ZONE']]) |
46 | 48 | return self.cursor.execute(query, args) |
47 | 49 | except Database.IntegrityError, e: |
48 | 50 | raise utils.IntegrityError, utils.IntegrityError(*tuple(e)), sys.exc_info()[2] |
… |
… |
class DatabaseWrapper(BaseDatabaseWrapper):
|
176 | 178 | if set_tz: |
177 | 179 | cursor.execute("SET TIME ZONE %s", [settings_dict['TIME_ZONE']]) |
178 | 180 | self._get_pg_version() |
179 | | return CursorWrapper(cursor) |
| 181 | return CursorWrapper(cursor, settings_dict) |
180 | 182 | |
181 | 183 | def _enter_transaction_management(self, managed): |
182 | 184 | """ |