Re: Indexes on Expressions -- Parentheses

From: Stephan Szabo <sszabo(at)megazone(dot)bigpanda(dot)com>
To: "Thomas F(dot)O'Connell" <tfo(at)sitening(dot)com>
Cc: General <pgsql-general(at)postgresql(dot)org>
Subject: Re: Indexes on Expressions -- Parentheses
Date: 2004-09-29 05:30:55
Message-ID: 20040928222637.L43334@megazone.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs pgsql-general

sszabo(at)bigpanda(dot)com

On Tue, 28 Sep 2004, Thomas F.O'Connell wrote:

> 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 ) );

Extract(year from some_column) is not really just a function call it's
an expression that looks similar to a function call because that's how SQL
defined it.

In response to

Responses

Browse pgsql-docs by date

  From Date Subject
Next Message Thomas F.O'Connell 2004-09-29 12:35:32 EXTRACT Clarification
Previous Message Thomas F.O'Connell 2004-09-29 03:44:28 Indexes on Expressions -- Parentheses

Browse pgsql-general by date

  From Date Subject
Next Message Neil Conway 2004-09-29 06:00:31 Re: To OID or not to OID
Previous Message Andre Maasikas 2004-09-29 05:15:07 Re: Controlling order of evaluation?