How can I configure postgreSQL to search without acents?

Is PostgreSQL have this support?

I configured my locale to pt_BR, that support acents, create table with
enconding "latin1", but nothing works. I know that I can use function
"TO_ASCII", and "select like "t_s%".

Like:

Table test
Clumns: name , values:
Test
Test
tést
Tést


SELECT * FROM test WHERE name LIKE tes%

And it should return values tést, test

Thanks,

Augusto


Mon, 2 Feb 2004 21:20:38 -0200
"Augusto Cesar Castoldi" <castoldi@npd.ufsc.br>
Seaching without accents
On Mon, 2 Feb 2004, Augusto Cesar Castoldi wrote:

> How can I configure postgreSQL to search without acents?
> 
> Is PostgreSQL have this support?
> 
> I configured my locale to pt_BR, that support acents, create table with
> enconding "latin1", but nothing works. I know that I can use function
> "TO_ASCII", and "select like "t_s%".
> 
> Like:
> 
> Table ï¿½testï¿½
> Clumns: name , values:
> Test
> Test
> tï¿½st
> Tï¿½st

Did you run initdb with --locale=pt_BR

???  It's got to be done at initdb time, after that it's too late to 
change it.


Mon, 2 Feb 2004 16:51:40 -0700 (MST)
"scott.marlowe" <scott.marlowe@ihs.com>
Re: Seaching without accents
Yes,

I tried to initdb isso locale too.

Didnt worked, now my linux is configured with pt_BR, than in initdb
appers there, "using locale pt_BR"

Why it doesn't work? Did you tried it? 

Is there something related with "Indexes" ? Do I need to create one? If
I create an Index, it will save the rows in 'index' without acents?

Thanks,

Augusto



-----Mensagem original-----
De: pgsql-hackers-owner@postgresql.org
[mailto:pgsql-hackers-owner@postgresql.org] Em nome de scott.marlowe
Enviada em: Monday, February 02, 2004 9:52 PM
Para: Augusto Cesar Castoldi
Cc: pgsql-hackers@postgresql.org
Assunto: Re: [HACKERS] Seaching without accents

On Mon, 2 Feb 2004, Augusto Cesar Castoldi wrote:

> How can I configure postgreSQL to search without acents?
> 
> Is PostgreSQL have this support?
> 
> I configured my locale to pt_BR, that support acents, create table
with
> enconding "latin1", but nothing works. I know that I can use function
> "TO_ASCII", and "select like "t_s%".
> 
> Like:
> 
> Table test
> Clumns: name , values:
> Test
> Test
> tést
> Tést

Did you run initdb with --locale=pt_BR

???  It's got to be done at initdb time, after that it's too late to 
change it.


---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
    (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)


Mon, 2 Feb 2004 22:04:03 -0200
"Augusto Cesar Castoldi" <castoldi@npd.ufsc.br>
RES: Seaching without accents
Hi Augusto,

> How can I configure postgreSQL to search without acents?
> Is PostgreSQL have this support?
> 
There isn't a specific function in postgresql. Maybe you could implement it in PL/Perl or any other PL/* language.

> SELECT * FROM test WHERE name LIKE _tes%_
> 
> And it should return values _tést, test_
> 
It's not a good idea to use _ to replace accents 'cause it would match undesirable expressions like tost, tist, tust, txst, etc.


-- 
Euler Taveira de Oliveira
euler (at) ufgnet.ufg.br
Desenvolvedor Web e Administrador de Sistemas
UFGNet - Universidade Federal de Goiás

Tue, 3 Feb 2004 15:40:09 -0200
Euler Taveira de Oliveira <euler@ufgnet.ufg.br>
Re: Seaching without accents