Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1UkGg2-0001Q9-T8 for pgsql-bugs@arkaria.postgresql.org; Wed, 05 Jun 2013 16:35:11 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1UkGg2-0003T9-Dg for pgsql-bugs@arkaria.postgresql.org; Wed, 05 Jun 2013 16:35:10 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1UkGg1-0003T2-PO for pgsql-bugs@postgresql.org; Wed, 05 Jun 2013 16:35:09 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1UkGfz-0008Hz-C7 for pgsql-bugs@postgresql.org; Wed, 05 Jun 2013 16:35:09 +0000 Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.5/8.14.5) with ESMTP id r55GZ614025397; Wed, 5 Jun 2013 12:35:06 -0400 (EDT) From: Tom Lane To: acizov@gmail.com cc: pgsql-bugs@postgresql.org Subject: Re: BUG #8211: Syntax error when creating index on expression In-reply-to: References: Comments: In-reply-to acizov@gmail.com message dated "Wed, 05 Jun 2013 15:24:28 -0000" Date: Wed, 05 Jun 2013 12:35:06 -0400 Message-ID: <25396.1370450106@sss.pgh.pa.us> X-Pg-Spam-Score: 0.3 (/) 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 acizov@gmail.com writes: > CREATE INDEX heuristic ON foos (1 / (a + b)) > causes: > ERROR: syntax error at or near "1" This is not a bug. You need an extra pair of parentheses around the expression, ie CREATE INDEX heuristic ON foos ((1 / (a + b))) http://www.postgresql.org/docs/9.2/static/sql-createindex.html points this out both in the syntax diagram and the text. regards, tom lane -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs