Index: django/db/models/fields/__init__.py
===================================================================
--- django/db/models/fields/__init__.py	(revision 11879)
+++ django/db/models/fields/__init__.py	(working copy)
@@ -732,6 +732,19 @@
         defaults.update(kwargs)
         return super(IntegerField, self).formfield(**defaults)
 
+class BigIntegerField(IntegerField):
+    empty_strings_allowed = False
+    description = ugettext_lazy("Big (8 byte) integer")
+    MAX_BIGINT = 9223372036854775807
+    def get_internal_type(self):
+        return "BigIntegerField"
+
+    def formfield(self, **kwargs):
+        defaults = {'min_value': -BigIntegerField.MAX_BIGINT - 1,
+                    'max_value': BigIntegerField.MAX_BIGINT}
+        defaults.update(kwargs)
+        return super(BigIntegerField, self).formfield(**defaults)
+
 class IPAddressField(Field):
     empty_strings_allowed = False
     description = ugettext_lazy("IP address")
Index: django/db/backends/postgresql/introspection.py
===================================================================
--- django/db/backends/postgresql/introspection.py	(revision 11879)
+++ django/db/backends/postgresql/introspection.py	(working copy)
@@ -4,6 +4,7 @@
     # Maps type codes to Django Field types.
     data_types_reverse = {
         16: 'BooleanField',
+        20: 'BigIntegerField',
         21: 'SmallIntegerField',
         23: 'IntegerField',
         25: 'TextField',
Index: django/db/backends/postgresql/creation.py
===================================================================
--- django/db/backends/postgresql/creation.py	(revision 11879)
+++ django/db/backends/postgresql/creation.py	(working copy)
@@ -18,6 +18,7 @@
         'FilePathField':     'varchar(%(max_length)s)',
         'FloatField':        'double precision',
         'IntegerField':      'integer',
+        'BigIntegerField':   'bigint',
         'IPAddressField':    'inet',
         'NullBooleanField':  'boolean',
         'OneToOneField':     'integer',
Index: django/db/backends/sqlite3/introspection.py
===================================================================
--- django/db/backends/sqlite3/introspection.py	(revision 11879)
+++ django/db/backends/sqlite3/introspection.py	(working copy)
@@ -16,6 +16,7 @@
         'smallinteger': 'SmallIntegerField',
         'int': 'IntegerField',
         'integer': 'IntegerField',
+        'bigint': 'BigIntegerField',
         'integer unsigned': 'PositiveIntegerField',
         'decimal': 'DecimalField',
         'real': 'FloatField',
Index: django/db/backends/sqlite3/creation.py
===================================================================
--- django/db/backends/sqlite3/creation.py	(revision 11879)
+++ django/db/backends/sqlite3/creation.py	(working copy)
@@ -19,6 +19,7 @@
         'FilePathField':                'varchar(%(max_length)s)',
         'FloatField':                   'real',
         'IntegerField':                 'integer',
+        'BigIntegerField':              'bigint',
         'IPAddressField':               'char(15)',
         'NullBooleanField':             'bool',
         'OneToOneField':                'integer',
Index: django/db/backends/mysql/introspection.py
===================================================================
--- django/db/backends/mysql/introspection.py	(revision 11879)
+++ django/db/backends/mysql/introspection.py	(working copy)
@@ -17,7 +17,7 @@
         FIELD_TYPE.FLOAT: 'FloatField',
         FIELD_TYPE.INT24: 'IntegerField',
         FIELD_TYPE.LONG: 'IntegerField',
-        FIELD_TYPE.LONGLONG: 'IntegerField',
+        FIELD_TYPE.LONGLONG: 'BigIntegerField',
         FIELD_TYPE.SHORT: 'IntegerField',
         FIELD_TYPE.STRING: 'CharField',
         FIELD_TYPE.TIMESTAMP: 'DateTimeField',
Index: django/db/backends/mysql/creation.py
===================================================================
--- django/db/backends/mysql/creation.py	(revision 11879)
+++ django/db/backends/mysql/creation.py	(working copy)
@@ -18,6 +18,7 @@
         'FilePathField':     'varchar(%(max_length)s)',
         'FloatField':        'double precision',
         'IntegerField':      'integer',
+        'BigIntegerField':   'bigint',
         'IPAddressField':    'char(15)',
         'NullBooleanField':  'bool',
         'OneToOneField':     'integer',
Index: django/db/backends/oracle/introspection.py
===================================================================
--- django/db/backends/oracle/introspection.py	(revision 11879)
+++ django/db/backends/oracle/introspection.py	(working copy)
@@ -29,7 +29,10 @@
     def get_field_type(self, data_type, description):
         # If it's a NUMBER with scale == 0, consider it an IntegerField
         if data_type == cx_Oracle.NUMBER and description[5] == 0:
-            return 'IntegerField'
+            if description[4] > 11:
+                return 'BigIntegerField'
+            else:
+                return 'IntegerField'
         else:
             return super(DatabaseIntrospection, self).get_field_type(
                 data_type, description)
Index: django/db/backends/oracle/creation.py
===================================================================
--- django/db/backends/oracle/creation.py	(revision 11879)
+++ django/db/backends/oracle/creation.py	(working copy)
@@ -27,6 +27,7 @@
         'FilePathField':                'NVARCHAR2(%(max_length)s)',
         'FloatField':                   'DOUBLE PRECISION',
         'IntegerField':                 'NUMBER(11)',
+        'BigIntegerField':              'NUMBER(19)',
         'IPAddressField':               'VARCHAR2(15)',
         'NullBooleanField':             'NUMBER(1) CHECK ((%(qn_column)s IN (0,1)) OR (%(qn_column)s IS NULL))',
         'OneToOneField':                'NUMBER(11)',
Index: django/contrib/admin/options.py
===================================================================
--- django/contrib/admin/options.py	(revision 11879)
+++ django/contrib/admin/options.py	(working copy)
@@ -42,14 +42,15 @@
         'form_class': forms.SplitDateTimeField,
         'widget': widgets.AdminSplitDateTime
     },
-    models.DateField:    {'widget': widgets.AdminDateWidget},
-    models.TimeField:    {'widget': widgets.AdminTimeWidget},
-    models.TextField:    {'widget': widgets.AdminTextareaWidget},
-    models.URLField:     {'widget': widgets.AdminURLFieldWidget},
-    models.IntegerField: {'widget': widgets.AdminIntegerFieldWidget},
-    models.CharField:    {'widget': widgets.AdminTextInputWidget},
-    models.ImageField:   {'widget': widgets.AdminFileWidget},
-    models.FileField:    {'widget': widgets.AdminFileWidget},
+    models.DateField:       {'widget': widgets.AdminDateWidget},
+    models.TimeField:       {'widget': widgets.AdminTimeWidget},
+    models.TextField:       {'widget': widgets.AdminTextareaWidget},
+    models.URLField:        {'widget': widgets.AdminURLFieldWidget},
+    models.IntegerField:    {'widget': widgets.AdminIntegerFieldWidget},
+    models.BigIntegerField: {'widget': widgets.AdminIntegerFieldWidget},
+    models.CharField:       {'widget': widgets.AdminTextInputWidget},
+    models.ImageField:      {'widget': widgets.AdminFileWidget},
+    models.FileField:       {'widget': widgets.AdminFileWidget},
 }
 
 
Index: tests/modeltests/model_forms/models.py
===================================================================
--- tests/modeltests/model_forms/models.py	(revision 11879)
+++ tests/modeltests/model_forms/models.py	(working copy)
@@ -13,12 +13,6 @@
 from django.db import models
 from django.core.files.storage import FileSystemStorage
 
-# Python 2.3 doesn't have sorted()
-try:
-    sorted
-except NameError:
-    from django.utils.itercompat import sorted
-
 temp_storage_dir = tempfile.mkdtemp()
 temp_storage = FileSystemStorage(temp_storage_dir)
 
@@ -201,6 +195,12 @@
     def __unicode__(self):
         return self.name
 
+class BigInt(models.Model):
+    biggie = models.BigIntegerField()
+
+    def __unicode__(self):
+        return unicode(self.biggie)
+
 __test__ = {'API_TESTS': """
 >>> from django import forms
 >>> from django.forms.models import ModelForm, model_to_dict
@@ -1145,6 +1145,28 @@
 # Delete the current file since this is not done by Django.
 >>> instance.file.delete()
 >>> instance.delete()
+
+# BigIntegerField ################################################################
+>>> class BigIntForm(forms.ModelForm):
+...     class Meta:
+...         model = BigInt
+... 
+>>> bif = BigIntForm({'biggie': '-9223372036854775808'})
+>>> bif.is_valid()
+True
+>>> bif = BigIntForm({'biggie': '-9223372036854775809'})
+>>> bif.is_valid()
+False
+>>> bif.errors
+{'biggie': [u'Ensure this value is greater than or equal to -9223372036854775808.']}
+>>> bif = BigIntForm({'biggie': '9223372036854775807'})
+>>> bif.is_valid()
+True
+>>> bif = BigIntForm({'biggie': '9223372036854775808'})
+>>> bif.is_valid()
+False
+>>> bif.errors
+{'biggie': [u'Ensure this value is less than or equal to 9223372036854775807.']}
 """}
 
 if test_images:
Index: tests/regressiontests/model_fields/tests.py
===================================================================
--- tests/regressiontests/model_fields/tests.py	(revision 11879)
+++ tests/regressiontests/model_fields/tests.py	(working copy)
@@ -6,7 +6,7 @@
 from django.db import models
 from django.core.exceptions import ValidationError
 
-from models import Foo, Bar, Whiz, BigD, BigS, Image
+from models import Foo, Bar, Whiz, BigD, BigS, Image, BigInt
 
 try:
     from decimal import Decimal
@@ -144,3 +144,32 @@
         bs = BigS.objects.create(s = 'slug'*50)
         bs = BigS.objects.get(pk=bs.pk)
         self.assertEqual(bs.s, 'slug'*50)
+
+class BigIntegerFieldTests(django.test.TestCase):
+    def test_limits(self):
+        # Ensure that values that are right at the limits can be saved
+        # and then retrieved without corruption. 
+        maxval = 9223372036854775807
+        minval = -maxval - 1
+        BigInt.objects.create(value=maxval)
+        qs = BigInt.objects.filter(value__gte=maxval)
+        self.assertEqual(qs.count(), 1)
+        self.assertEqual(qs[0].value, maxval)
+        BigInt.objects.create(value=minval)
+        qs = BigInt.objects.filter(value__lte=minval)
+        self.assertEqual(qs.count(), 1)
+        self.assertEqual(qs[0].value, minval)
+
+    def test_types(self):
+        b = BigInt(value = 0)
+        self.assertTrue(isinstance(b.value, (int, long)))
+        b.save()
+        self.assertTrue(isinstance(b.value, (int, long)))
+        b = BigInt.objects.all()[0]
+        self.assertTrue(isinstance(b.value, (int, long)))
+
+    def test_coercing(self):
+        BigInt.objects.create(value ='10')
+        b = BigInt.objects.get(value = '10')
+        self.assertEqual(b.value, 10)
+
Index: tests/regressiontests/model_fields/models.py
===================================================================
--- tests/regressiontests/model_fields/models.py	(revision 11879)
+++ tests/regressiontests/model_fields/models.py	(working copy)
@@ -51,6 +51,9 @@
 class BigS(models.Model):
     s = models.SlugField(max_length=255)
 
+class BigInt(models.Model):
+    value = models.BigIntegerField()
+    null_value = models.BigIntegerField(null = True, blank = True)
 
 ###############################################################################
 # ImageField
Index: tests/regressiontests/introspection/tests.py
===================================================================
--- tests/regressiontests/introspection/tests.py	(revision 11879)
+++ tests/regressiontests/introspection/tests.py	(working copy)
@@ -77,7 +77,7 @@
         cursor = connection.cursor()
         desc = connection.introspection.get_table_description(cursor, Reporter._meta.db_table)
         self.assertEqual([datatype(r[1], r) for r in desc],
-                          ['IntegerField', 'CharField', 'CharField', 'CharField'])
+                          ['IntegerField', 'CharField', 'CharField', 'CharField', 'BigIntegerField'])
 
     # Regression test for #9991 - 'real' types in postgres
     if settings.DATABASE_ENGINE.startswith('postgresql'):
Index: tests/regressiontests/introspection/models.py
===================================================================
--- tests/regressiontests/introspection/models.py	(revision 11879)
+++ tests/regressiontests/introspection/models.py	(working copy)
@@ -4,6 +4,7 @@
     first_name = models.CharField(max_length=30)
     last_name = models.CharField(max_length=30)
     email = models.EmailField()
+    facebook_user_id = models.BigIntegerField()
 
     def __unicode__(self):
         return u"%s %s" % (self.first_name, self.last_name)
Index: docs/topics/forms/modelforms.txt
===================================================================
--- docs/topics/forms/modelforms.txt	(revision 11879)
+++ docs/topics/forms/modelforms.txt	(working copy)
@@ -46,6 +46,10 @@
     ===============================  ========================================
     ``AutoField``                    Not represented in the form
 
+    ``BigIntegerField``              ``IntegerField`` with ``min_value`` set
+                                     to -9223372036854775808 and ``max_value``
+                                     set to 9223372036854775807.
+
     ``BooleanField``                 ``BooleanField``
 
     ``CharField``                    ``CharField`` with ``max_length`` set to
@@ -108,6 +112,10 @@
     The ``FloatField`` form field and ``DecimalField`` model and form fields
     are new in Django 1.0.
 
+.. versionadded:: 1.2
+    The ``BigIntegerField`` is new in Django 1.2.
+
+
 As you might expect, the ``ForeignKey`` and ``ManyToManyField`` model field
 types are special cases:
 
Index: docs/ref/models/fields.txt
===================================================================
--- docs/ref/models/fields.txt	(revision 11879)
+++ docs/ref/models/fields.txt	(working copy)
@@ -299,6 +299,18 @@
 primary key field will automatically be added to your model if you don't specify
 otherwise. See :ref:`automatic-primary-key-fields`.
 
+``BigIntegerField``
+-------------------
+
+.. versionadded:: 1.2
+
+.. class:: BigIntegerField([**options])
+
+A 64 bit integer, much like an :class:`IntegerField` except that it is
+guaranteed to fit numbers from -9223372036854775808 to 9223372036854775807. The
+admin represents this as an ``<input type="text">`` (a single-line input).
+ 
+
 ``BooleanField``
 ----------------
 
