Re: Functional index adding one

Поиск
Список
Период
Сортировка
От Gregory Stark
Тема Re: Functional index adding one
Дата
Msg-id 8763rnay29.fsf@oxford.xeocode.com
обсуждение исходный текст
Ответ на Functional index adding one  (lbarcala@freeresearch.org)
Ответы Re: Functional index adding one  (Gregory Stark <stark@enterprisedb.com>)
Список pgsql-general
<lbarcala@freeresearch.org> writes:

> Hi all:
>
> I'm trying to create a functional index into column position of token
> table (see below). I want to make something like:
>
> CREATE INDEX token_position_func
> ON token (position+1);
>
> but I get:
>
> test=# CREATE INDEX token_position_func
> test-# ON token (position+1);
> ERROR:  syntax error at or near "+"
> LINE 2: ON token (position+1);
>

I think you just need another set of parentheses:

CREATE INDEX token_position_func on (token(position+1))

Unless you're on a very old version of Postgres, I think 7.3 which had
functional indexes but not expression indexes.

--
  Gregory Stark
  EnterpriseDB          http://www.enterprisedb.com
  Ask me about EnterpriseDB's On-Demand Production Tuning

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

Предыдущее
От: Lennin Caro
Дата:
Сообщение: Re: pg_ctl start check sum failed
Следующее
От: "Long Cui"
Дата:
Сообщение: simple installation problem in windows system