Create index ... On ... (lower(field1), lower(field2)) doesn't work?

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

Create index ... On ... (lower(field1), lower(field2)) doesn't work?

От:
"Glen Parker" <glenebob@nwlink.com>
Дата:
Creating indexes on multiple function-modified fields is illegal...
Parser bug?
Example:

testdb=# create index idx_test on test (lower(field1), lower(field2));
ERROR:  parser: parse error at or near ","

Any way around this?

 --
Glen Parker
glenebob@nwlink.com


Re: Create index ... On ... (lower(field1), lower(field2)) doesn't work?

От:
Bruno Wolff III <bruno@wolff.to>
Дата:
On Wed, Aug 07, 2002 at 16:51:07 -0700,
  Glen Parker  wrote:
> Creating indexes on multiple function-modified fields is illegal...
> Parser bug?
> Example:
> 
> testdb=# create index idx_test on test (lower(field1), lower(field2));
> ERROR:  parser: parse error at or near ","
> 
> Any way around this?

I believe the current work around is to create a composite function
that returns something indexable. This isn't quite the same since you
won't be able to use the index for just one of the functions. If you
need that as well, you will need to create a second index.
FAQ