Thread: Case insensitive uniqueness on column?

Case insensitive uniqueness on column?

From
doug
Date:
Can this be done in postgres?


Re: Case insensitive uniqueness on column?

From
Bruce Momjian
Date:
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