Re: Best way to store case-insensitive data?

From: Lew <noone(at)lewscanon(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Best way to store case-insensitive data?
Date: 2010-06-13 16:07:32
Message-ID: hv2vo1$sop$1@news.albasani.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message fdd sds 2010-06-13 16:38:32 Re: pgcon 2010 videos?
Previous Message Tim Landscheidt 2010-06-13 15:32:55 Re: how to alias a table