Обсуждение: Case in-sensitive

Поиск
Список
Период
Сортировка

Case in-sensitive

От
"Carmen Wai"
Дата:
Hello:

Can I config the Postgresql so that it can match case in-sensitive pattern
automatically? i.e. I don't need to explicit convert the pattern to lower
case like this: .....WHERE lower(textfield) LIKE lower(pattern)

Thanks a lot!

Carmen

_________________________________________________________________
Chat with friends online, try MSN Messenger: http://messenger.msn.com


Re: Case in-sensitive

От
"Christopher Kings-Lynne"
Дата:
> Can I config the Postgresql so that it can match case
> in-sensitive pattern
> automatically? i.e. I don't need to explicit convert the pattern to lower
> case like this: .....WHERE lower(textfield) LIKE lower(pattern)

All you need to do is this:

......WHERE textfield ILIKE pattern

Chris


Re: Case in-sensitive

От
Josh Berkus
Дата:
Chris,

> > Can I config the Postgresql so that it can match case
> > in-sensitive pattern
> > automatically? i.e. I don't need to explicit convert the pattern to lower
> > case like this: .....WHERE lower(textfield) LIKE lower(pattern)
>
> All you need to do is this:
>
> ......WHERE textfield ILIKE pattern

Though, keep in mind, lower(textfield) can be indexed, but ILIKE textfield
cannot.

--
-Josh Berkus
 Aglio Database Solutions
 San Francisco