Re: [GENERAL] Case insensitive unique constraint

2005-07-15 Thread Vivek Khera
On Jul 14, 2005, at 3:14 AM, Rob Brenart wrote: 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. Is there an easy way to

Re: [GENERAL] Case insensitive unique constraint

2005-07-15 Thread John D. Burger
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

Re: [GENERAL] Case insensitive unique constraint

2005-07-14 Thread Rob Brenart
Klint Gore wrote: On Thu, 14 Jul 2005 02:14:16 -0500, Rob Brenart <[EMAIL PROTECTED]> wrote: 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 t

Re: [GENERAL] Case insensitive unique constraint

2005-07-14 Thread Andreas Seltenreich
Rob Brenart schrob: > 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. > > Is there an easy way to go about this? Would crea

Re: [GENERAL] Case insensitive unique constraint

2005-07-14 Thread Klint Gore
On Thu, 14 Jul 2005 02:14:16 -0500, Rob Brenart <[EMAIL PROTECTED]> wrote: > 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.

Re: [GENERAL] Case insensitive unique constraint

2005-07-14 Thread Roman Neuhauser
# [EMAIL PROTECTED] / 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

[GENERAL] Case insensitive unique constraint

2005-07-14 Thread Rob Brenart
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. Is there an easy way to go about this? Am I about to write my first server sid