RE: [SQL] Case insensitive equality operator

Поиск
Список
Период
Сортировка
Искать
От
Jackson, DeJuan
Тема
RE: [SQL] Case insensitive equality operator
Дата
Msg-id
F10BB1FAF801D111829B0060971D839F5C5E5C@cpsmail
Список


> -----Original Message-----
> I'm looking for a case insensitive equality operator (something like
> ~~*). There are of course regular expression matches but I am
> reluctent to use them because I need to preprocess my string before
> using it (putting it between a ^ and a $, escaping special 
> characters) 
> and because I'm afraid that the use of regular expressions will be
> more resource demanding than a simple equality.
> 
> Any ideas ?
> 
> Cheers

Why don't you just use the upper or lower functions.
i.e. SELECT * from t1 WHERE UPPER(a)= 'BLAH';
You could even use a functional index on a
CREATE INDEX upper_a ON t1 (UPPER(a) text_ops);
	-DEJ
В списке pgsql-sql по дате отправления
От: Christophe Labouisse
Дата:
От: Nick Massaro
Дата:
Сообщение: force indexed search?
FAQ