Indexes on Expressions -- Parentheses

From: Thomas F(dot)O'Connell <tfo(at)sitening(dot)com>
To: General <pgsql-general(at)postgresql(dot)org>
Subject: Indexes on Expressions -- Parentheses
Date: 2004-09-29 03:44:28
Message-ID: DD3C2AD6-11C9-11D9-8537-000D93AE0944@sitening.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs pgsql-general

From 11.5 in the docs:

"The syntax of the CREATE INDEX command normally requires writing
parentheses around index expressions, as shown in the second example.
The parentheses may be omitted when the expression is just a function
call, as in the first example."

But when I try this:

db=# CREATE INDEX expression_idx on some_table( extract( year from
some_column ) );

I get a syntax error corresponding to the open parenthesis after
extract (and whitespace is not the issue).

If I add an enclosing set of parentheses, E.g.:

db=# CREATE INDEX expression_idx on some_table( ( extract( year from
some_column ) ) );

it works!

Is this a known issue?

-tfo

Responses

Browse pgsql-docs by date

  From Date Subject
Next Message Stephan Szabo 2004-09-29 05:30:55 Re: Indexes on Expressions -- Parentheses
Previous Message Robert Treat 2004-09-21 20:47:32 Re: windows docs?

Browse pgsql-general by date

  From Date Subject
Next Message Andre Maasikas 2004-09-29 05:15:07 Re: Controlling order of evaluation?
Previous Message Michael Fuhr 2004-09-29 01:13:18 Re: Foreign key order evaluation