Re: How to use as Functional Index to be used as Primary KEY

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Janning Vygen <vygen(at)gmx(dot)de>, pgsql-general(at)postgresql(dot)org
Subject: Re: How to use as Functional Index to be used as Primary KEY
Date: 2004-07-31 15:02:26
Message-ID: 200407311702.26430.peter_e@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Janning Vygen wrote:
> Of course i can use an index like this:
>
> CREATE TABLE members (
> nickname text NOT NULL,
> );
> CREATE UNIQUE INDEX ix_name ON test (lower(name));
>
> but the key isn't marked as primary then.
>
> So here is my question: How can i define a functional index to be
> used with a primary key (using postgreSQL 7.4.3)?

You can't. The primary key must be an actual data value. You can
define a more restrictive unique constraint in addition.

--
Peter Eisentraut
http://developer.postgresql.org/~petere/

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2004-07-31 15:09:35 Re: Correct escaping of untrusted data
Previous Message Janning Vygen 2004-07-31 13:48:06 How to use as Functional Index to be used as Primary KEY