Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed #8592 -- Fixed a bug in the way savepoint usage was disabled for

PostgreSQL < 8.0.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@8648 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 21672c26bf4604e57de4b2a64ec92ef8de53b834 1 parent 59607bb
@malcolmt malcolmt authored
View
9 django/db/backends/postgresql/base.py
@@ -117,11 +117,10 @@ def _cursor(self, settings):
if set_tz:
cursor.execute("SET TIME ZONE %s", [settings.TIME_ZONE])
if not hasattr(self, '_version'):
- version = get_version(cursor)
- self.__class__._version = version
- if version < (8, 0):
- # No savepoint support for earlier version of PostgreSQL.
- self.features.uses_savepoints = False
+ self.__class__._version = get_version(cursor)
+ if self._version < (8, 0):
+ # No savepoint support for earlier version of PostgreSQL.
+ self.features.uses_savepoints = False
cursor.execute("SET client_encoding to 'UNICODE'")
cursor = UnicodeCursorWrapper(cursor, 'utf-8')
return cursor
View
9 django/db/backends/postgresql_psycopg2/base.py
@@ -89,9 +89,8 @@ def _cursor(self, settings):
if set_tz:
cursor.execute("SET TIME ZONE %s", [settings.TIME_ZONE])
if not hasattr(self, '_version'):
- version = get_version(cursor)
- self.__class__._version = version
- if version < (8, 0):
- # No savepoint support for earlier version of PostgreSQL.
- self.features.uses_savepoints = False
+ self.__class__._version = get_version(cursor)
+ if self._version < (8, 0):
+ # No savepoint support for earlier version of PostgreSQL.
+ self.features.uses_savepoints = False
return cursor

0 comments on commit 21672c2

Please sign in to comment.
Something went wrong with that request. Please try again.