Received: from localhost.localdomain (postgresql.org [64.49.215.8]) by localhost (Postfix) with ESMTP id B0B72476440 for ; Tue, 25 Jun 2002 17:16:13 -0400 (EDT) Mailbox-Line: From bruno@wolff.to Tue Jun 25 17:16:13 2002 Received: from wolff.to (wolff.to [66.92.219.49]) by postgresql.org (Postfix) with SMTP id 893AC47607A for ; Tue, 25 Jun 2002 16:29:51 -0400 (EDT) Received: (qmail 23807 invoked by uid 500); 25 Jun 2002 20:34:53 -0000 Date: Tue, 25 Jun 2002 15:34:53 -0500 From: Bruno Wolff III To: Josh Berkus Cc: pgsql-sql@postgresql.org Subject: Re: unique index on function and column Message-ID: <20020625203453.GA23747@wolff.to> Mail-Followup-To: Josh Berkus , pgsql-sql@postgresql.org References: <20020625175828.GA11107@wolff.to> <200206251309.25232.josh@agliodbs.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200206251309.25232.josh@agliodbs.com> User-Agent: Mutt/1.3.25i X-Spam-Status: No, hits=-5.3 required=5.0 tests=IN_REP_TO,X_NOT_PRESENT version=2.30 X-Spam-Level: X-Archive-Number: 200206/339 X-Sequence-Number: 8304 On Tue, Jun 25, 2002 at 13:09:25 -0700, Josh Berkus wrote: > Bruno, > > > Is there a simple way to do something like the following: > > create unique index inst_u_app on inst (lower(host), psport); > > > > It looks like you can have an index on several columns, but not > > several functions. > > So? Create two seperate indexes. > > Multi-column indexes are almost always less useful that you'd expected, > anyway. I was using it to implement a constraint, not to do searches. Two separate indexes wouldn't work for that.