An interesting situation here. I have never stopped thinking about this before. It seems that the use of UPPER for iexact searches was introduced in edition 8536 in response to ticket 3575 , almost three years ago. Prior to this, Django used ILIKE for these types of searches.
I looked at the backend code and the only thing I can find points to any UPPER vs LOWER reason, it seems that Oracle uses uppercase by default when processing UPPER data. Since other agnostics, it seems, Django decided by default UPPER cover all the bases.
Another impression I got from viewing the source code was that you are not going to get by with UPPER . This is literally everywhere, not just the actual query of the database. The Python UPPER string extension is used quite often.
I would say that itβs best to just create an index using upper(column) , not, and go for a drink.
source share