Case insensitive uniqueness on column?

Started by dougalmost 23 years ago2 messagesgeneral
Jump to latest
#1doug
douglaskorchinski@nospam.shaw.ca

Can this be done in postgres?

#2Bruce Momjian
bruce@momjian.us
In reply to: doug (#1)
Re: Case insensitive uniqueness on column?

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