<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