Question about encoding

Started by Daniel Serodioover 19 years ago4 messagesgeneral
Jump to latest
#1Daniel 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

#2Richard Broersma Jr
rabroersma@yahoo.com
In reply to: Daniel Serodio (#1)
Re: Question about encoding

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.

#3Albe Laurenz
all@adv.magwien.gv.at
In reply to: Richard Broersma Jr (#2)
Re: Question about encoding

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

#4Daniel Serodio
dserodio@gmail.com
In reply to: Richard Broersma Jr (#2)
Re: Question about encoding

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