To handle searching for a row based on a string, I will use
"LOWER(colname)
= 'x'" and "LOWER(colname) LIKE 'x%'". AFAICT, the second one is
equivalent
to "colname ILIKE 'x%'", provided I force 'x' to lowercase first.
I would strongly suggest you do this instead:
LOWER(colname) = LOWER('x')
This is far more bullet-proof than lower-casing in the client, in case
the client and the server differ (mismatched locales, etc.). If you
don't want to use ILIKE for portability reasons (perfectly reasonable),
I suggest the analogous:
LOWER(colname) LIKE LOWER('x%')
- John D. Burger
MITRE
---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster