Search Postgresql Archives

Re: Case insensitive unique constraint

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



 create unique index tbl_iname_idx on tbl (lower(name_field))

By the way, in case it wasn't obvious, this has a nice side-benefit. Namely, PG will use that index for caseless lookups, so you can do this:

  select * from tbl where lower(name_field) = lower('John');

very efficiently.

- John D. Burger
  MITRE



---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux