diff -r 9b24e08becc2 django/db/backends/creation.py
--- a/django/db/backends/creation.py	Sat Nov 13 18:43:13 2010 +0000
+++ b/django/db/backends/creation.py	Tue Dec 07 20:44:39 2010 +0100
@@ -3,6 +3,7 @@
 
 from django.conf import settings
 from django.core.management import call_command
+from django.utils.datastructures import DictWrapper
 
 # The prefix to put on the default database name when creating
 # the test database.
@@ -26,6 +27,19 @@
         shorten identifying names.
         """
         return '%x' % (abs(hash(args)) % 4294967296L)  # 2**32
+    
+    def db_type(self, field):
+        return self._db_type(field, field.get_internal_type())
+
+    def related_db_type(self, field):
+        return self._db_type(field, field.get_related_internal_type())
+
+    def _db_type(self, field, internal_type):
+        data = DictWrapper(field.__dict__, self.connection.ops.quote_name, "qn_")
+        try:
+            return self.connection.creation.data_types[internal_type] % data
+        except KeyError:
+            return None
 
     def sql_create_model(self, model, style, known_models=set()):
         """
diff -r 9b24e08becc2 django/db/models/fields/__init__.py
--- a/django/db/models/fields/__init__.py	Sat Nov 13 18:43:13 2010 +0000
+++ b/django/db/models/fields/__init__.py	Tue Dec 07 20:44:39 2010 +0100
@@ -13,7 +13,6 @@
 from django.conf import settings
 from django import forms
 from django.core import exceptions, validators
-from django.utils.datastructures import DictWrapper
 from django.utils.functional import curry
 from django.utils.text import capfirst
 from django.utils.translation import ugettext_lazy as _
@@ -215,11 +214,11 @@
         # mapped to one of the built-in Django field types. In this case, you
         # can implement db_type() instead of get_internal_type() to specify
         # exactly which wacky database column type you want to use.
-        data = DictWrapper(self.__dict__, connection.ops.quote_name, "qn_")
-        try:
-            return connection.creation.data_types[self.get_internal_type()] % data
-        except KeyError:
-            return None
+        return connection.creation.db_type(self)
+
+    def related_db_type(self, connection):
+        # This is the db_type used by a ForeignKey.
+        return connection.creation.related_db_type(self)
 
     def unique(self):
         return self._unique or self.primary_key
@@ -252,6 +251,9 @@
     def get_internal_type(self):
         return self.__class__.__name__
 
+    def get_related_internal_type(self):
+        return self.get_internal_type()
+
     def pre_save(self, model_instance, add):
         "Returns field's value just before saving."
         return getattr(model_instance, self.attname)
@@ -462,6 +464,15 @@
     def get_internal_type(self):
         return "AutoField"
 
+    def get_related_internal_type(self):
+        return "RelatedAutoField"
+
+    def related_db_type(self, connection):
+        db_type = super(AutoField, self).related_db_type(connection=connection)
+        if db_type is None:
+            return IntegerField().db_type(connection=connection)
+        return db_type
+
     def to_python(self, value):
         if value is None:
             return value
@@ -979,6 +990,12 @@
 class PositiveIntegerField(IntegerField):
     description = _("Integer")
 
+    def related_db_type(self, connection):
+        if not connection.features.related_fields_match_type:
+            return IntegerField().related_db_type(connection=connection)
+        return super(PositiveIntegerField, self).related_db_type(
+            connection=connection)
+
     def get_internal_type(self):
         return "PositiveIntegerField"
 
@@ -989,6 +1006,13 @@
 
 class PositiveSmallIntegerField(IntegerField):
     description = _("Integer")
+
+    def related_db_type(self, connection):
+        if not connection.features.related_fields_match_type:
+            return IntegerField().related_db_type(connection=connection)
+        return super(PositiveSmallIntegerField, self).related_db_type(
+            connection=connection)
+
     def get_internal_type(self):
         return "PositiveSmallIntegerField"
 
diff -r 9b24e08becc2 django/db/models/fields/related.py
--- a/django/db/models/fields/related.py	Sat Nov 13 18:43:13 2010 +0000
+++ b/django/db/models/fields/related.py	Tue Dec 07 20:44:39 2010 +0100
@@ -1,5 +1,5 @@
 from django.conf import settings
-from django.db import connection, router, transaction
+from django.db import connection, router, transaction, connections
 from django.db.backends import util
 from django.db.models import signals, get_model
 from django.db.models.fields import (AutoField, Field, IntegerField,
@@ -859,7 +859,7 @@
             return None
         else:
             return self.rel.get_related_field().get_db_prep_save(value,
-                connection=connection)
+                    connection=connections[router.db_for_read(self.rel.to)])
 
     def value_to_string(self, obj):
         if not obj:
@@ -908,12 +908,7 @@
         # If the database needs similar types for key fields however, the only
         # thing we can do is making AutoField an IntegerField.
         rel_field = self.rel.get_related_field()
-        if (isinstance(rel_field, AutoField) or
-                (not connection.features.related_fields_match_type and
-                isinstance(rel_field, (PositiveIntegerField,
-                                       PositiveSmallIntegerField)))):
-            return IntegerField().db_type(connection=connection)
-        return rel_field.db_type(connection=connection)
+        return rel_field.related_db_type(connection=connections[router.db_for_read(rel_field.model)])
 
 class OneToOneField(ForeignKey):
     """
