Searching for "bare" letters - Mailing list pgsql-general

From Reuven M. Lerner
Subject Searching for "bare" letters
Date
Msg-id 4E87A14F.5010804@lerner.co.il
Whole thread Raw
Responses Re: Searching for "bare" letters  (planas <jslozier@gmail.com>)
Re: Searching for "bare" letters  (Uwe Schroeder <uwe@oss4u.com>)
Re: Searching for "bare" letters  (hamann.w@t-online.de)
Re: Searching for "bare" letters  (Eduardo Morras <nec556@retena.com>)
Re: Searching for "bare" letters  (Eduardo Morras <nec556@retena.com>)
List pgsql-general
<p>Hi, everyone.  I'm working on a project on PostgreSQL 9.0 (soon to be upgraded to 9.1, given that we haven't yet
launched). The project will involve numerous text fields containing English, Spanish, and Portuguese.  Some of those
textfields will be searchable by the user.  That's easy enough to do; for our purposes, I was planning to use some
combinationof LIKE searches; the database is small enough that this doesn't take very much time, and we don't expect
thenumber of searchable records (or columns within those records) to be all that large.<p>The thing is, the people
runningthe site want searches to work on what I'm calling (for lack of a better term) "bare" letters.  That is, if the
usersearches for "n", then the search should also match Spanish words containing "ñ".  I'm told by Spanish-speaking
membersof the team that this is how they would expect searches to work.  However, when I just did a quick test using a
UTF-8encoded 9.0 database, I found that PostgreSQL didn't  see the two characters as identical.  (I must say, this is
thebehavior that I would have expected, had the Spanish-speaking team member not said anything on the subject.)<p>So my
questionis whether I can somehow wrangle PostgreSQL into thinking that "n" and "ñ" are the same character for search
purposes,or if I need to do something else -- use regexps, keep a "naked," searchable version of each column alongside
thenative one, or something else entirely -- to get this to work.<p>Any ideas?<p>Thanks,<p>Reuven<br /><p><pre
class="moz-signature"cols="72">-- 
 
Reuven M. Lerner -- Web development, consulting, and training
Mobile: +972-54-496-8405 * US phone: 847-230-9795
Skype/AIM: reuvenlerner
</pre>

pgsql-general by date:

Previous
From: Chris Travers
Date:
Subject: Re: SQL Help - Finding Next Lowest Value of Current Row Value
Next
From: planas
Date:
Subject: Re: Searching for "bare" letters