Re: Case insensitive unique constraint

Поиск
Список
Период
Сортировка
От Roman Neuhauser
Тема Re: Case insensitive unique constraint
Дата
Msg-id 20050714080331.GA72206@isis.sigpipe.cz
обсуждение исходный текст
Ответ на Case insensitive unique constraint  (Rob Brenart <postgresql@oculardata.com>)
Список pgsql-general
# postgresql@oculardata.com / 2005-07-14 02:14:16 -0500:
> I have a simple table to store account names... I want each name to be
> unique in a case insensitive manner... but I want the case the user
> enters to be remembered so I can't do a simple lower() on the data's way in.

    CREATE TABLE tbl (col VARCHAR(32) NOT NULL);
    CREATE UNIQUE INDEX ON tbl (UPPER(col));

--
How many Vietnam vets does it take to screw in a light bulb?
You don't know, man.  You don't KNOW.
Cause you weren't THERE.             http://bash.org/?255991

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

Предыдущее
От: Klint Gore
Дата:
Сообщение: Re: Case insensitive unique constraint
Следующее
От: Tino Wildenhain
Дата:
Сообщение: Re: To Postgres or not