X-Original-To: pgsql-docs-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 3A03332A26F for ; Wed, 29 Sep 2004 13:35:55 +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 15602-01 for ; Wed, 29 Sep 2004 12:35:40 +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 890BA32A183 for ; Wed, 29 Sep 2004 13:35:38 +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 1CCdgE-00027Y-00; Wed, 29 Sep 2004 08:35:34 -0400 In-Reply-To: <20040928222637.L43334@megazone.bigpanda.com> References: <20040928222637.L43334@megazone.bigpanda.com> Mime-Version: 1.0 (Apple Message framework v619) Content-Type: text/plain; charset=US-ASCII; format=flowed Message-Id: <0E177963-1214-11D9-8537-000D93AE0944@sitening.com> Content-Transfer-Encoding: 7bit Cc: pgsql-docs@postgresql.org From: Thomas F.O'Connell Subject: EXTRACT Clarification Date: Wed, 29 Sep 2004 08:35:32 -0400 To: Stephan Szabo 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/37 X-Sequence-Number: 2556 Switching this thread to DOCS and renaming it... Anyway, I think that this situation calls for some clarification in the docs. If others agree, I'd be happy to submit a potential patch. I'm thinking something like this (with thanks to Stephan): Note: EXTRACT is not a true function. SQL defines it as an expression that happens to look similar to a function call. Is this wording acceptable? I'd imagine putting it at the end of 9.8.1. Also, are there other expressions that fall into this category? I don't know the spec well enough to know. -tfo On Sep 29, 2004, at 1:30 AM, Stephan Szabo wrote: > sszabo@bigpanda.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.