para Bancos UTF-8, para bancos normais tirar o "convert"

SELECT * FROM table WHERE
*to_ascii*(*convert*(name, 'unicode', 'latin1'), 'latin1') ilike *to_ascii*(
*convert*('%$keyword%', 'unicode', 'latin1'), 'latin1');

2008/3/24 Silfar Goulart <[EMAIL PROTECTED]>:

> De novo, só funciona se o encoding for latin1 ou win1252
>
> Em 24/03/08, Marco Aurélio Carvalho Feitosa <[EMAIL PROTECTED]> escreveu:
>
> >  Para bancos em UTF8 use
> >
> > SELECT nm_banco from banco where to_ascii(nm_banco,'LATIN1') ilike
> > '%cred%';
> >
> >
> > []'s
> >
> > Marco Aurélio C Feitosa
> >
> >
> > Silfar Goulart escreveu:
> >
> > Sim Dickson, mas isso só funciona se o banco estiver em latin se ele
> > estiver em utf8 nao rola:
> >
> >
> > SELECT nm_banco from banco where to_ascii(nm_banco) ilike '%cred%';
> >
> > ERROR:  encoding conversion from UTF8 to ASCII not supported
> >
> > 2008/3/24, Dickson Guedes <[EMAIL PROTECTED]>:
> > >
> > > Silfar Goulart escreveu:
> > >
> > > > Bom gente já tentei de tudo, esta é a minha ultima tentativa.
> > > Preciso
> > > > fazer um select que me retorne uma consulta que ignore acentos tipo
> > > >
> > > > se eu buscar por jose tem que vir josé, jose etc...
> > > >
> > > > Alguem sabe com eu faço isso ?
> > >
> > >
> > > local=# SELECT nome from pessoa where to_ascii(nome) ilike '%jose%';
> > >          nome
> > > ---------------------
> > >   Antonia Josefina
> > >   José Silveira
> > >   José da Silva Sauro
> > > (3 registros)
> > >
> > >
> > >
> > > []s
> > >
> > > Guedes
> > >
> > > _______________________________________________
> > > pgbr-geral mailing list
> > > [email protected]
> > > https://listas.postgresql.org.br/cgi-bin/mailman/listinfo/pgbr-geral
> > >
> >
> >
> >
> > --
> > Silfar Goulart
> >
> > ------------------------------
> >
> > _______________________________________________
> > pgbr-geral mailing list
> > [email protected]
> > https://listas.postgresql.org.br/cgi-bin/mailman/listinfo/pgbr-geral
> >
> >
> >
> > _______________________________________________
> > pgbr-geral mailing list
> > [email protected]
> > https://listas.postgresql.org.br/cgi-bin/mailman/listinfo/pgbr-geral
> >
> >
>
>
> --
> Silfar Goulart
> _______________________________________________
> pgbr-geral mailing list
> [email protected]
> https://listas.postgresql.org.br/cgi-bin/mailman/listinfo/pgbr-geral
>
>


-- 
// Miere Teixeira - Web 2.0 Master Group
// "Get the power: read the source!"
// C/C++/Python/PHP 5/Shell Programming
_______________________________________________
pgbr-geral mailing list
[email protected]
https://listas.postgresql.org.br/cgi-bin/mailman/listinfo/pgbr-geral

Responder a