Received: from localhost.localdomain (postgresql.org [64.49.215.8]) by localhost (Postfix) with ESMTP id 47867476411 for ; Tue, 25 Jun 2002 15:20:13 -0400 (EDT) Mailbox-Line: From tgl@sss.pgh.pa.us Tue Jun 25 15:20:13 2002 Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by postgresql.org (Postfix) with ESMTP id C47714765F1 for ; Tue, 25 Jun 2002 14:35:16 -0400 (EDT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.11.4/8.11.4) with ESMTP id g5PIZG109833; Tue, 25 Jun 2002 14:35:16 -0400 (EDT) To: Bruno Wolff III Cc: pgsql-sql@postgresql.org Subject: Re: unique index on function and column In-reply-to: <20020625175828.GA11107@wolff.to> References: <20020625175828.GA11107@wolff.to> Comments: In-reply-to Bruno Wolff III message dated "Tue, 25 Jun 2002 12:58:28 -0500" Date: Tue, 25 Jun 2002 14:35:16 -0400 Message-ID: <9830.1025030116@sss.pgh.pa.us> From: Tom Lane 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/336 X-Sequence-Number: 8301 Bruno Wolff III writes: > 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. The standard answer is to make a custom function that accepts all the columns and produces a result you can index. This is sort of an academic "an existence proof is good enough" answer, but it *is* possible to get the results you want. Making it more convenient hasn't risen to the top of anyone's to-do list. regards, tom lane