Re: Case sensitivity

Поиск
Список
Период
Сортировка
От John D. Burger
Тема Re: Case sensitivity
Дата
Msg-id 9edcc3260f4ffac66b6f02acfe17bf8a@mitre.org
обсуждение исходный текст
Ответ на Re: Case sensitivity  ("Frank Millman" <frank@chagford.com>)
Список pgsql-general
> 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



В списке pgsql-general по дате отправления:

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: Re: pgsql and php with ssl mode.
Следующее
От: Tim Nelson
Дата:
Сообщение: ODBC issue with aggregate fields (SUM)