Re: How to create a case-insensitive unique constraint?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: How to create a case-insensitive unique constraint?
Дата
Msg-id 6404.1220391052@sss.pgh.pa.us
обсуждение исходный текст
Ответ на How to create a case-insensitive unique constraint?  ("Kynn Jones" <kynnjo@gmail.com>)
Список pgsql-general
"Kynn Jones" <kynnjo@gmail.com> writes:
> ALTER TABLE foo
>   ADD CONSTRAINT foo_unique_xy
>   UNIQUE ( UPPER( x ), UPPER( y ) );

> ...I get a syntax error

This is disallowed by the SQL standard: UNIQUE constraints can only be
on plain columns.  (The practical reason for following their rule is
that there'd be no way to represent more-general constraints in the
information_schema.)

Use the CREATE UNIQUE INDEX syntax instead.

            regards, tom lane

В списке pgsql-general по дате отправления:

Предыдущее
От: Raymond O'Donnell
Дата:
Сообщение: Re: plpgsql returning resultset
Следующее
От: "Dennis Brakhane"
Дата:
Сообщение: Re: How to create a case-insensitive unique constraint?