Re: How to use as Functional Index to be used as Primary KEY - Mailing list pgsql-general

From Peter Eisentraut
Subject Re: How to use as Functional Index to be used as Primary KEY
Date
Msg-id 200407311702.26430.peter_e@gmx.net
Whole thread Raw
In response to How to use as Functional Index to be used as Primary KEY  (Janning Vygen <vygen@gmx.de>)
List 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/


pgsql-general by date:

Previous
From: Janning Vygen
Date:
Subject: How to use as Functional Index to be used as Primary KEY
Next
From: Tom Lane
Date:
Subject: Re: Correct escaping of untrusted data