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

Поиск
Список
Период
Сортировка
От Peter Eisentraut
Тема Re: How to use as Functional Index to be used as Primary KEY
Дата
Msg-id 200407311702.26430.peter_e@gmx.net
обсуждение исходный текст
Ответ на How to use as Functional Index to be used as Primary KEY  (Janning Vygen <vygen@gmx.de>)
Список 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 по дате отправления:

Предыдущее
От: Janning Vygen
Дата:
Сообщение: How to use as Functional Index to be used as Primary KEY
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Correct escaping of untrusted data