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 165A052AF3 for ; Fri, 8 Jul 2005 13:15:17 -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 94062-02 for ; Fri, 8 Jul 2005 16:15:07 +0000 (GMT) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by svr1.postgresql.org (Postfix) with ESMTP id 8F63252AE5 for ; Fri, 8 Jul 2005 13:15:05 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.1/8.13.1) with ESMTP id j68GF4pL023333; Fri, 8 Jul 2005 12:15:04 -0400 (EDT) To: Ying Lu Cc: pgsql-sql@postgresql.org Subject: Re: Index creation question for expression (col1 || '-' || col2) In-reply-to: <42CEA509.3090507@cs.concordia.ca> References: <42CEA509.3090507@cs.concordia.ca> Comments: In-reply-to Ying Lu message dated "Fri, 08 Jul 2005 12:08:41 -0400" Date: Fri, 08 Jul 2005 12:15:04 -0400 Message-ID: <23332.1120839304@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.006 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200507/84 X-Sequence-Number: 22062 Ying Lu writes: > A question about creating index for the following expression. > CREATE INDEX idx_t1 ON test (col1 || '-' || col2); You need more parentheses: CREATE INDEX idx_t1 ON test ((col1 || '-' || col2)); regards, tom lane