Re: Best way to store case-insensitive data?
Lew <noone@lewscanon.com>
From: Lew <noone@lewscanon.com>
To: pgsql-general@postgresql.org
Date: 2010-06-13T16:07:32Z
Lists: pgsql-general
Please don't top-post. Mike Christensen wrote: > Ah, I should probably upgrade to 8.4. However, I'll probably just > wait for 9.0 to come out. So it seems like citext will be about the > same as casting both sides to LOWER(), plus putting an index on the > lowercase version of the text. I'd probably use that if it were out > of the box, but I'm trying to stay away from adding too many > dependencies.. I think I'll stick with my original approach of only > storing lowercase data in the DB, and perhaps put a CHECK constraint > on there to ensure no upper case letters sneak in. If your db contains international text there are some corner cases where lower( upper( val )) != val or upper( lower( val )) != val. Or there should be, because that's what happens in certain languages. For example, upper-case 'ß' should be 'SS' in German. Lower-case 'SS' is 'ss'. -- Lew