Indexes on Expressions -- Parentheses - Mailing list pgsql-general

From Thomas F.O'Connell
Subject Indexes on Expressions -- Parentheses
Date
Msg-id DD3C2AD6-11C9-11D9-8537-000D93AE0944@sitening.com
Whole thread Raw
Responses Re: Indexes on Expressions -- Parentheses
List pgsql-general
From 11.5 in the docs:


<bigger><bigger>"The syntax of the
</bigger></bigger><fontfamily><param>Courier</param><x-tad-bigger>CREATE
INDEX</x-tad-bigger></fontfamily><bigger><bigger> 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."


</bigger></bigger>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
 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

pgsql-general by date:

Previous
From: Russell Smith
Date:
Subject: Re: Controlling order of evaluation?
Next
From: Andre Maasikas
Date:
Subject: Re: Controlling order of evaluation?