diff options
| author | Malcolm Tredinnick <malcolm.tredinnick@gmail.com> | 2008-08-12 05:34:56 +0000 |
|---|---|---|
| committer | Malcolm Tredinnick <malcolm.tredinnick@gmail.com> | 2008-08-12 05:34:56 +0000 |
| commit | 220993bcc52e78520d8e6cc8aa022608eac10b2a (patch) | |
| tree | ce95383ebb30e67874dbe5b908e693086a4d60c3 /django/db/backends/postgresql/base.py | |
| parent | e73bf2bdd9a6342e8bf10c78ca94415e02cb8838 (diff) | |
Added savepoint support to the transaction code.
This is a no-op for most databases. Only necessary on PostgreSQL so that we can
do things which will possibly intentionally raise an IntegrityError and not
have to rollback the entire transaction. Not supported for PostgreSQL versions
prior to 8.0, so should be used sparingly in internal Django code.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8314 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, 5 insertions, 2 deletions
diff --git a/django/db/backends/postgresql/base.py b/django/db/backends/postgresql/base.py index 4a8d6ebef0..792026530f 100644 --- a/django/db/backends/postgresql/base.py +++ b/django/db/backends/postgresql/base.py @@ -63,6 +63,9 @@ class UnicodeCursorWrapper(object): def __iter__(self): return iter(self.cursor) +class DatabaseFeatures(BaseDatabaseFeatures): + uses_savepoints = True + class DatabaseWrapper(BaseDatabaseWrapper): operators = { 'exact': '= %s', @@ -83,8 +86,8 @@ class DatabaseWrapper(BaseDatabaseWrapper): def __init__(self, *args, **kwargs): super(DatabaseWrapper, self).__init__(*args, **kwargs) - - self.features = BaseDatabaseFeatures() + + self.features = DatabaseFeatures() self.ops = DatabaseOperations() self.client = DatabaseClient() self.creation = DatabaseCreation(self) |
