Author: mtredinnick
Date: 2008-08-28 01:49:00 -0500 (Thu, 28 Aug 2008)
New Revision: 8648

Modified:
   django/trunk/django/db/backends/postgresql/base.py
   django/trunk/django/db/backends/postgresql_psycopg2/base.py
Log:
Fixed #8592 -- Fixed a bug in the way savepoint usage was disabled for
PostgreSQL < 8.0.


Modified: django/trunk/django/db/backends/postgresql/base.py
===================================================================
--- django/trunk/django/db/backends/postgresql/base.py  2008-08-28 06:00:08 UTC 
(rev 8647)
+++ django/trunk/django/db/backends/postgresql/base.py  2008-08-28 06:49:00 UTC 
(rev 8648)
@@ -117,11 +117,10 @@
         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

Modified: django/trunk/django/db/backends/postgresql_psycopg2/base.py
===================================================================
--- django/trunk/django/db/backends/postgresql_psycopg2/base.py 2008-08-28 
06:00:08 UTC (rev 8647)
+++ django/trunk/django/db/backends/postgresql_psycopg2/base.py 2008-08-28 
06:49:00 UTC (rev 8648)
@@ -89,9 +89,8 @@
         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


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to