--- django/db/backends/postgresql_psycopg2/base.py.0    2007-10-30 10:13:56.000000000 +0100
+++ django/db/backends/postgresql_psycopg2/base.py  2007-10-30 10:22:16.000000000 +0100
@@ -20,6 +20,7 @@

 class DatabaseFeatures(BaseDatabaseFeatures):
     needs_datetime_string_cast = False
+    needs_upper_for_iops = True

 class DatabaseOperations(PostgresqlDatabaseOperations):
     def last_executed_query(self, cursor, sql, params):
@@ -33,9 +34,9 @@
     ops = DatabaseOperations()
     operators = {
         'exact': '= %s',
-        'iexact': 'ILIKE %s',
+        'iexact': 'LIKE UPPER(%s)',
         'contains': 'LIKE %s',
-        'icontains': 'ILIKE %s',
+        'icontains': 'LIKE UPPER(%s)',
         'regex': '~ %s',
         'iregex': '~* %s',
         'gt': '> %s',
@@ -44,8 +45,8 @@
         'lte': '<= %s',
         'startswith': 'LIKE %s',
         'endswith': 'LIKE %s',
-        'istartswith': 'ILIKE %s',
-        'iendswith': 'ILIKE %s',
+        'istartswith': 'LIKE UPPER(%s)',
+        'iendswith': 'LIKE UPPER(%s)',
     }

     def _cursor(self, settings):
