Re: unique index on function and column

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bruno Wolff III <bruno(at)wolff(dot)to>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: unique index on function and column
Date: 2002-06-25 18:35:16
Message-ID: 9830.1025030116@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Bruno Wolff III <bruno(at)wolff(dot)to> 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

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Bruno Wolff III 2002-06-25 18:45:58 Re: unique index on function and column
Previous Message Bruno Wolff III 2002-06-25 17:58:28 unique index on function and column