diff options
| author | Malcolm Tredinnick <malcolm.tredinnick@gmail.com> | 2008-08-12 06:31:29 +0000 |
|---|---|---|
| committer | Malcolm Tredinnick <malcolm.tredinnick@gmail.com> | 2008-08-12 06:31:29 +0000 |
| commit | 6bebb23318c5a2195a89a7154118cfc5ea19bba7 (patch) | |
| tree | 942a07924c6496096e19ae3bc83483786b73372c /django/db/backends/postgresql/base.py | |
| parent | 97da73a98cfe5e5545b7d997e6078c8571115a76 (diff) | |
Do not use savepoints with PostgreSQL prior to 8.0.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8317 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/db/backends/postgresql/base.py')
| -rw-r--r-- | django/db/backends/postgresql/base.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/django/db/backends/postgresql/base.py b/django/db/backends/postgresql/base.py index 792026530f..7bcda5b6f6 100644 --- a/django/db/backends/postgresql/base.py +++ b/django/db/backends/postgresql/base.py @@ -9,6 +9,7 @@ from django.db.backends.postgresql.client import DatabaseClient from django.db.backends.postgresql.creation import DatabaseCreation from django.db.backends.postgresql.introspection import DatabaseIntrospection from django.db.backends.postgresql.operations import DatabaseOperations +from django.db.backends.postgresql.version import get_version from django.utils.encoding import smart_str, smart_unicode try: @@ -115,6 +116,12 @@ class DatabaseWrapper(BaseDatabaseWrapper): cursor = self.connection.cursor() 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 cursor.execute("SET client_encoding to 'UNICODE'") cursor = UnicodeCursorWrapper(cursor, 'utf-8') return cursor |
