Re: BUG #8211: Syntax error when creating index on expression

From: David Johnston <polobo(at)yahoo(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #8211: Syntax error when creating index on expression
Date: 2013-06-05 17:26:54
Message-ID: 1370453214059-5758040.post@n5.nabble.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

bricklen wrote
> expression
>
> An expression based on one or more columns of the table. The expression
> usually must be written with surrounding parentheses, as shown in the
> syntax. However, the parentheses can be omitted if the expression has the
> form of a function call.

So in fact the example provided:

CREATE INDEX ON films ((lower(title)));

could be written as:

CREATE INDEX ON films (lower(title));

The example expression has yet one additional pair of "()" that are not
required per the syntax since lower(...) is a function call. Extra "()"
never hurt I suppose...

I don't see this come up too often on the list but I will agree that it is
unexpected to require the extra set of "()". An example using an actual
expression with the extra "()" and then the function call example without -
to explicitly show when/why they can be omitted in the examples as well as
in the text - is an idea worth considering.

David J.

--
View this message in context: http://postgresql.1045698.n5.nabble.com/BUG-8211-Syntax-error-when-creating-index-on-expression-tp5758030p5758040.html
Sent from the PostgreSQL - bugs mailing list archive at Nabble.com.

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message eric-postgresql 2013-06-05 17:45:45 BUG #8213: Set-valued function error in union
Previous Message Tom Lane 2013-06-05 16:35:06 Re: BUG #8211: Syntax error when creating index on expression