#12583: Postgresql backend uses implicit text casts for case insensitive operators
----------------------------------------------+-----------------------------
Reporter: Ubercore | Owner: nobody
Status: new | Milestone:
Component: Database layer (models, ORM) | Version: SVN
Keywords: postgresql cast case-insensitive | Stage: Unreviewed
Has_patch: 0 |
----------------------------------------------+-----------------------------
In django.db.backends.postgresql.operations.DatabaseOperations, a case
insensitive lookup produces
{{{
UPPER(%s::text)
}}}
as the lookup cast sql.
In django.db.backends.postgresql.DatabaseWrapper.operators, a case
insensitive lookup produces
{{{
UPPER(%s)
}}}
Since Postgres 8.3 removed implicit casts, all operators should use
::text. Not doing so breaks lookups that use a type other than text:
{{{
AModel.objects.filter(col1__iexact=4)
}}}
--
Ticket URL: <
http://code.djangoproject.com/ticket/12583>
Django <
http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.