summaryrefslogtreecommitdiff
path: root/django/db/backends/postgresql/operations.py
diff options
context:
space:
mode:
authorMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2008-08-12 05:34:56 +0000
committerMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2008-08-12 05:34:56 +0000
commit220993bcc52e78520d8e6cc8aa022608eac10b2a (patch)
treece95383ebb30e67874dbe5b908e693086a4d60c3 /django/db/backends/postgresql/operations.py
parente73bf2bdd9a6342e8bf10c78ca94415e02cb8838 (diff)
downloaddjango-220993bcc52e78520d8e6cc8aa022608eac10b2a.tar.gz
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/operations.py')
-rw-r--r--django/db/backends/postgresql/operations.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/django/db/backends/postgresql/operations.py b/django/db/backends/postgresql/operations.py
index de7b5a9520..4eb5ead47c 100644
--- a/django/db/backends/postgresql/operations.py
+++ b/django/db/backends/postgresql/operations.py
@@ -124,3 +124,13 @@ class DatabaseOperations(BaseDatabaseOperations):
style.SQL_KEYWORD('FROM'),
style.SQL_TABLE(qn(f.m2m_db_table()))))
return output
+
+ def savepoint_create_sql(self, sid):
+ return "SAVEPOINT %s" % sid
+
+ def savepoint_commit_sql(self, sid):
+ return "RELEASE SAVEPOINT %s" % sid
+
+ def savepoint_rollback_sql(self, sid):
+ return "ROLLBACK TO SAVEPOINT %s" % sid
+