Skip to content

Commit

Permalink
Fixed #8592 -- Fixed a bug in the way savepoint usage was disabled for
Browse files Browse the repository at this point in the history
PostgreSQL < 8.0.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@8648 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information
malcolmt committed Aug 28, 2008
1 parent 59607bb commit 21672c2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
9 changes: 4 additions & 5 deletions django/db/backends/postgresql/base.py
Expand Up @@ -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
Expand Down
9 changes: 4 additions & 5 deletions django/db/backends/postgresql_psycopg2/base.py
Expand Up @@ -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.