Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
Thread:
Lists: pgsql-docspgsql-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

pgsql-docs by date

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

pgsql-general by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group