X-Original-To: pgsql-general-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 7D5E732A247 for ; Wed, 29 Sep 2004 04:45:46 +0100 (BST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 66544-07 for ; Wed, 29 Sep 2004 03:45:10 +0000 (GMT) Received: from smtp04.mrf.mail.rcn.net (smtp04.mrf.mail.rcn.net [207.172.4.63]) by svr1.postgresql.org (Postfix) with ESMTP id 5FF8832A23E for ; Wed, 29 Sep 2004 04:44:55 +0100 (BST) Received: from 209-6-216-111.c3-0.smr-ubr3.sbo-smr.ma.cable.rcn.com ([209.6.216.111] helo=[192.168.0.8]) by smtp04.mrf.mail.rcn.net with esmtp (Exim 3.35 #7) id 1CCVOH-0006Ga-00 for pgsql-general@postgresql.org; Tue, 28 Sep 2004 23:44:29 -0400 Mime-Version: 1.0 (Apple Message framework v619) To: General Message-Id: Content-Type: multipart/alternative; boundary=Apple-Mail-36-10667609 From: Thomas F.O'Connell Subject: Indexes on Expressions -- Parentheses Date: Tue, 28 Sep 2004 23:44:28 -0400 X-Mailer: Apple Mail (2.619) X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200409/1217 X-Sequence-Number: 66423 --Apple-Mail-36-10667609 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; format=flowed 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 --Apple-Mail-36-10667609 Content-Transfer-Encoding: 7bit Content-Type: text/enriched; charset=US-ASCII From 11.5 in the docs: "The syntax of the CourierCREATE 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 --Apple-Mail-36-10667609--