lower() for varchar data by creating an index

Поиск
Список
Период
Сортировка
Искать
От
Alex Guryanow
Тема
lower() for varchar data by creating an index
Дата
в 03:52:53
Msg-id
11494.000517@nlr.ru
Список
Дерево обсуждения
lower() for varchar data by creating an index Alex Guryanow <gav@nlr.ru>
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
Дата:
От: Yamini Sharma
Дата:
FAQ