public inbox for [email protected]  
help / color / mirror / Atom feed
From: Thomas F.O'Connell <[email protected]>
To: General <[email protected]>
Subject: Indexes on Expressions -- Parentheses
Date: Tue, 28 Sep 2004 23:44:28 -0400
Message-ID: <[email protected]> (raw)

 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

view thread (13+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected]
  Subject: Re: Indexes on Expressions -- Parentheses
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox