Index: django/db/backends/mysql/base.py
===================================================================
--- django/db/backends/mysql/base.py	(revision 9793)
+++ django/db/backends/mysql/base.py	(working copy)
@@ -289,3 +289,9 @@
                 raise Exception('Unable to determine MySQL version from version string %r' % self.connection.get_server_info())
             self.server_version = tuple([int(x) for x in m.groups()])
         return self.server_version
+
+    def begin_defer_constraint_checks(self):
+        self.cursor().execute('SET foreign_key_checks=0')
+        
+    def end_defer_constraint_checks(self):
+        self.cursor().execute('SET foreign_key_checks=1')
\ No newline at end of file
Index: django/db/backends/__init__.py
===================================================================
--- django/db/backends/__init__.py	(revision 9793)
+++ django/db/backends/__init__.py	(working copy)
@@ -51,6 +51,12 @@
         if not self.features.uses_savepoints:
             return
         self.connection.cursor().execute(self.ops.savepoint_commit_sql(sid))
+        
+    def begin_defer_constraint_checks(self):
+        return None
+    
+    def end_defer_constraint_checks(self):
+        return None
 
     def close(self):
         if self.connection is not None:
Index: django/core/management/commands/loaddata.py
===================================================================
--- django/core/management/commands/loaddata.py	(revision 9793)
+++ django/core/management/commands/loaddata.py	(working copy)
@@ -76,6 +76,8 @@
         if has_bz2:
             compression_types['bz2'] = bz2.BZ2File
 
+        connection.begin_defer_constraint_checks()
+
         app_fixtures = [os.path.join(os.path.dirname(app.__file__), 'fixtures') for app in get_apps()]
         for fixture_label in fixture_labels:
             parts = fixture_label.split('.')
@@ -103,6 +105,7 @@
                 sys.stderr.write(
                     self.style.ERROR("Problem installing fixture '%s': %s is not a known serialization format." %
                         (fixture_name, format)))
+                connection.end_defer_constraint_checks()
                 transaction.rollback()
                 transaction.leave_transaction_management()
                 return
@@ -136,6 +139,7 @@
                                 fixture.close()
                                 print self.style.ERROR("Multiple fixtures named '%s' in %s. Aborting." %
                                     (fixture_name, humanize(fixture_dir)))
+                                connection.end_defer_constraint_checks()
                                 transaction.rollback()
                                 transaction.leave_transaction_management()
                                 return
@@ -158,6 +162,7 @@
                                 except Exception:
                                     import traceback
                                     fixture.close()
+                                    connection.end_defer_constraint_checks()
                                     transaction.rollback()
                                     transaction.leave_transaction_management()
                                     if show_traceback:
@@ -176,6 +181,7 @@
                                     sys.stderr.write(
                                         self.style.ERROR("No fixture data found for '%s'. (File format may be invalid.)" %
                                             (fixture_name)))
+                                    connection.end_defer_constraint_checks()
                                     transaction.rollback()
                                     transaction.leave_transaction_management()
                                     return
@@ -195,6 +201,7 @@
                 for line in sequence_sql:
                     cursor.execute(line)
 
+        connection.end_defer_constraint_checks()
         if commit:
             transaction.commit()
             transaction.leave_transaction_management()
Index: tests/modeltests/mutually_referential/models.py
===================================================================
--- tests/modeltests/mutually_referential/models.py	(revision 9793)
+++ tests/modeltests/mutually_referential/models.py	(working copy)
@@ -31,6 +31,8 @@
 >>> q.bestchild = c
 >>> q.save()
 
+>>> from django.db import connection
+>>> connection.begin_defer_constraint_checks()
 >>> q.delete()
-
+>>> connection.end_defer_constraint_checks()
 """}
\ No newline at end of file
Index: tests/modeltests/serializers/models.py
===================================================================
--- tests/modeltests/serializers/models.py	(revision 9793)
+++ tests/modeltests/serializers/models.py	(working copy)
@@ -164,13 +164,18 @@
 
 # Objects ids can be referenced before they are defined in the serialization data
 # However, the deserialization process will need to be contained within a transaction
+# Furthermore since some DBs don't support deferred constraint checking, we must
+# signal begin/end of a block that may contain forward references so that constraint
+# checking may be temporarily disabled, if necessary to allow forward references.
 >>> json = '[{"pk": 3, "model": "serializers.article", "fields": {"headline": "Forward references pose no problem", "pub_date": "2006-06-16 15:00:00", "categories": [4, 1], "author": 4}}, {"pk": 4, "model": "serializers.category", "fields": {"name": "Reference"}}, {"pk": 4, "model": "serializers.author", "fields": {"name": "Agnes"}}]'
->>> from django.db import transaction
+>>> from django.db import transaction, connection
 >>> transaction.enter_transaction_management()
 >>> transaction.managed(True)
+>>> connection.begin_defer_constraint_checks()
 >>> for obj in serializers.deserialize("json", json):
 ...     obj.save()
 
+>>> connection.end_defer_constraint_checks()
 >>> transaction.commit()
 >>> transaction.leave_transaction_management()
 
Index: tests/modeltests/delete/models.py
===================================================================
--- tests/modeltests/delete/models.py	(revision 9793)
+++ tests/modeltests/delete/models.py	(working copy)
@@ -93,6 +93,7 @@
 #  - remove the second set of tests (with a2, b2 etc)
 
 >>> from django.db.models.loading import cache
+>>> from django.db import connection
 
 >>> def clear_rel_obj_caches(models):
 ...     for m in models:
@@ -168,7 +169,9 @@
 >>> o.keys()
 [<class 'modeltests.delete.models.F'>, <class 'modeltests.delete.models.E'>]
 
+>>> connection.begin_defer_constraint_checks()
 >>> e1.delete()
+>>> connection.end_defer_constraint_checks()
 
 >>> e2 = E()
 >>> e2.save()
@@ -184,7 +187,9 @@
 >>> o.keys()
 [<class 'modeltests.delete.models.F'>, <class 'modeltests.delete.models.E'>]
 
+>>> connection.begin_defer_constraint_checks()
 >>> f2.delete()
+>>> connection.end_defer_constraint_checks()
 
 """
 }
Index: tests/regressiontests/serializers_regress/tests.py
===================================================================
--- tests/regressiontests/serializers_regress/tests.py	(revision 9793)
+++ tests/regressiontests/serializers_regress/tests.py	(working copy)
@@ -13,7 +13,7 @@
 
 from django.utils.functional import curry
 from django.core import serializers
-from django.db import transaction
+from django.db import transaction, connection
 from django.core import management
 from django.conf import settings
 
@@ -354,6 +354,7 @@
     objects = []
     instance_count = {}
     transaction.enter_transaction_management()
+    connection.begin_defer_constraint_checks()
     try:
         transaction.managed(True)
         for (func, pk, klass, datum) in test_data:
@@ -362,8 +363,11 @@
         transaction.commit()
     except:
         transaction.rollback()
+        connection.end_defer_constraint_checks()
         transaction.leave_transaction_management()
         raise
+    
+    connection.end_defer_constraint_checks()
     transaction.leave_transaction_management()
 
     # Get a count of the number of objects created for each class
@@ -380,14 +384,18 @@
     management.call_command('flush', verbosity=0, interactive=False)
     transaction.enter_transaction_management()
     try:
+        connection.begin_defer_constraint_checks()
         transaction.managed(True)
         for obj in serializers.deserialize(format, serialized_data):
             obj.save()
         transaction.commit()
     except:
         transaction.rollback()
+        connection.end_defer_constraint_checks()
         transaction.leave_transaction_management()
         raise
+    
+    connection.end_defer_constraint_checks()    
     transaction.leave_transaction_management()
 
     # Assert that the deserialized data is the same
