Re: Accent insensitive search?

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Thom Brown <thombrown(at)gmail(dot)com>
Cc: Pedro Doria Meunier <pdoria(at)netmadeira(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: Accent insensitive search?
Date: 2009-03-18 18:24:36
Message-ID: 20090318182436.GI3798@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Thom Brown escribió:
> Here's an example of a function I might use (although I haven't actually got
> plperl installed, so can't test it myself, but you'll get the idea:
>
> CREATE OR REPLACE FUNCTION unaccent_string(text) RETURNS text AS $$
> my ($input_string) = @_;
> $input_string =~ s/[âãäåāăą]/a;
> $input_string =~ s/[ÁÂÃÄÅĀĂĄ]/A;

Hmm, if to_ascii() doesn't work, that's something worth some research.
Maybe the encoding config is broken, for example.

--
Alvaro Herrera http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Christophe 2009-03-18 18:35:42 Re: Accent insensitive search?
Previous Message Oleg Bartunov 2009-03-18 18:13:30 Re: Accent insensitive search?