Search Postgresql Archives

Re: Case insensitive unique constraint

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

 



# postgresql@xxxxxxxxxxxxxx / 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 VARCHAR(32) NOT NULL);
    CREATE UNIQUE INDEX ON tbl (UPPER(col));

-- 
How many Vietnam vets does it take to screw in a light bulb?
You don't know, man.  You don't KNOW.
Cause you weren't THERE.             http://bash.org/?255991

---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster

[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