Обсуждение: Case insensitive uniqueness on column?

Поиск
Список
Период
Сортировка

Case insensitive uniqueness on column?

От
doug
Дата:
Can this be done in postgres?


Re: Case insensitive uniqueness on column?

От
Bruce Momjian
Дата:
doug wrote:
> Can this be done in postgres?

You mean:

    Case insensitive uniqueness on column?

Yes.  You have to create a functional index on the column using
lower(col), like:

    CREATE UNIQUE INDEX uq on tab (lower(col))

I think that will work.

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073