Question about encoding

Поиск
Список
Период
Сортировка
Искать

Question about encoding

От:
"Daniel Serodio" <dserodio@gmail.com>
Дата:
Is it possible to configure PostgreSQL so that a " LIKE 'a' " query
will match a 'á' value, ie, make it accent-insensitive ?

Thanks in advance,
Daniel Serodio

Re: Question about encoding

От:
Richard Broersma Jr <rabroersma@yahoo.com>
Дата:
> Is it possible to configure PostgreSQL so that a " LIKE 'a' " query
> will match a 'á' value, ie, make it accent-insensitive ?

I forgot this was possible using regular expressions. I don't think it is possible using the LIKE
syntax.  if you use something like:

select * from yourtable
where yourstring ~ '[=e=]';

http://www.postgresql.org/docs/8.2/interactive/functions-matching.html#POSIX-BRACKET-EXPRESSIONS

Regards,

Richard Broersma Jr.

Re: Question about encoding

От:
"Albe Laurenz" <all@adv.magwien.gv.at>
Дата:
> Is it possible to configure PostgreSQL so that a " LIKE 'a' " query
> will match a 'á' value, ie, make it accent-insensitive ?

Maybe something like this can help you:

test=> select to_ascii(convert('tête-à-tête français', 'LATIN9'),'LATIN9');
       to_ascii       
----------------------
 tete-a-tete francais
(1 row)

If your database encoding is already LATIN9, you can omit the convert().

Yours,
Laurenz Albe

Re: Question about encoding

От:
"Daniel Serodio" <dserodio@gmail.com>
Дата:
Richard Broersma Jr wrote:
> > Is it possible to configure PostgreSQL so that a " LIKE 'a' " query
> > will match a 'á' value, ie, make it accent-insensitive ?
>
> I forgot this was possible using regular expressions. I don't think it is possible using the LIKE
> syntax.

What a pity, I've found a point where Microsoft SQL Server is better
than PostgreSQL ! :-)

How should I go about filing an RFE or equivalent?

TIA,
Daniel Serodio

FAQ