Search Postgresql Archives

Re: Case insensitive unique constraint

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

 



On Thu, 14 Jul 2005 02:14:16 -0500, Rob Brenart <postgresql@xxxxxxxxxxxxxx> 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 go about this? Am I about to write my first 
> server side function for postgresql?

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

klint.

+---------------------------------------+-----------------+
: Klint Gore                            : "Non rhyming    :
: EMail   : kg@xxxxxxxxxxxxxx           :  slang - the    :
: Snail   : A.B.R.I.                    :  possibilities  :
: Mail      University of New England   :  are useless"   :
:           Armidale NSW 2351 Australia :     L.J.J.      :
: Fax     : +61 2 6772 5376             :                 :
+---------------------------------------+-----------------+

---------------------------(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