Re: Case insensitive unique constraint

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Case insensitive unique constraint
Дата
Msg-id 27599.1397080813@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Case insensitive unique constraint  (Michael Rowan <michael.rowan3@gmail.com>)
Список pgsql-novice
Michael Rowan <michael.rowan3@gmail.com> writes:
> I would like to do this:
> ALTER TABLE a ADD CONSTRAINT a_unique UNIQUE lower(name)

You can't get to that through CONSTRAINT syntax, but you can just
create a unique index directly:

CREATE UNIQUE INDEX a_unique ON a (lower(name))

            regards, tom lane


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

Предыдущее
От: Michael Rowan
Дата:
Сообщение: Case insensitive unique constraint
Следующее
От: Darko J
Дата:
Сообщение: Variables inside PostgreSQL/PostGIS query in PHP file