X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 4962952ADD for ; Fri, 8 Jul 2005 14:08:59 -0300 (ADT) 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 17392-08 for ; Fri, 8 Jul 2005 17:08:58 +0000 (GMT) Received: from perseverance.encs.concordia.ca (perseverance-96.encs.concordia.ca [132.205.96.94]) by svr1.postgresql.org (Postfix) with ESMTP id BE26F52ABD for ; Fri, 8 Jul 2005 14:08:56 -0300 (ADT) Received: from [132.205.44.35] (IDENT:emilu@curacao.cs.concordia.ca [132.205.44.35]) by perseverance.encs.concordia.ca (8.12.11/8.12.11) with ESMTP id j68H8sCs011198; Fri, 8 Jul 2005 13:08:54 -0400 Message-ID: <42CEB325.90906@cs.concordia.ca> Date: Fri, 08 Jul 2005 13:08:53 -0400 From: Ying Lu User-Agent: Mozilla Thunderbird 1.0.2 (X11/20050317) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Michael Fuhr Cc: pgsql-sql@postgresql.org Subject: Re: Index creation question for expression (col1 || '-' || References: <42CEA509.3090507@cs.concordia.ca> <20050708163215.GA81846@winnie.fuhr.org> In-Reply-To: <20050708163215.GA81846@winnie.fuhr.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.43 on perseverance.encs.concordia.ca at 2005/07/08 13:08:54 EDT X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.013 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200507/88 X-Sequence-Number: 22066 >On Fri, Jul 08, 2005 at 12:08:41PM -0400, Ying Lu wrote: > > >>CREATE INDEX idx_t1 ON test (col1 || '-' || col2); >> >>May I know is it possible and how I may create index for the expression >>such as "col1 || '-' || col2" for a table please? >> >> > > >"The syntax of the CREATE INDEX command normally requires writing >parentheses around index expressions, as shown in the second >example...." > >That second example is exactly what you're trying to do: > >CREATE INDEX people_names ON people ((first_name || ' ' || last_name)); > > This is exactly what I want. I missed a pair of "()" :( . That is why I got an error. Thank you very much. - Emi