lower() for varchar data by creating an index

Поиск
Список
Период
Сортировка
От Alex Guryanow
Тема lower() for varchar data by creating an index
Дата
Msg-id 11494.000517@nlr.ru
обсуждение исходный текст
Список pgsql-sql
Hi,

I have a table called t1 with field f1 of type varchar(40):
 CREATE TABLE t1 (f1 varchar(40));

To make a case insensitive search I build the query like
  SELECT f1 FROM t1 WHERE lower( f1 ) LIKE 'alex%';

This works fine. But when I try to make an index to speed up the query using the command
    CREATE INDEX t1_f1_idx ON t1 (lower(f1));

I receive the following error:
 ERROR:  DefineIndex: function 'lower(varchar)' does not exist

Why by executing the query the function 'lower(varchar)' exists and by creating the index don't?

I use Postgres 7.0.

Best regards,
Alex




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

Предыдущее
От: "Rudolph, Michael"
Дата:
Сообщение: AW: What is the difference between NULL and "undef"
Следующее
От: Yamini Sharma
Дата:
Сообщение: Storing binary data in a column