Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1UkHUH-00049T-3w for pgsql-bugs@arkaria.postgresql.org; Wed, 05 Jun 2013 17:27:05 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1UkHUG-0001rD-JF for pgsql-bugs@arkaria.postgresql.org; Wed, 05 Jun 2013 17:27:04 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1UkHUE-0001r5-L4 for pgsql-bugs@postgresql.org; Wed, 05 Jun 2013 17:27:02 +0000 Received: from sam.nabble.com ([216.139.236.26]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1UkHU7-0000mg-GC for pgsql-bugs@postgresql.org; Wed, 05 Jun 2013 17:27:01 +0000 Received: from [192.168.236.26] (helo=sam.nabble.com) by sam.nabble.com with esmtp (Exim 4.72) (envelope-from ) id 1UkHU6-0006sR-28 for pgsql-bugs@postgresql.org; Wed, 05 Jun 2013 10:26:54 -0700 Date: Wed, 5 Jun 2013 10:26:54 -0700 (PDT) From: David Johnston To: pgsql-bugs@postgresql.org Message-ID: <1370453214059-5758040.post@n5.nabble.com> In-Reply-To: References: Subject: Re: BUG #8211: Syntax error when creating index on expression MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: 4.5 (++++) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org 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. -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs