Re: Locale and LIKE matching - Mailing list pgsql-general

From Peter Eisentraut
Subject Re: Locale and LIKE matching
Date
Msg-id Pine.LNX.4.30.0103310001330.1063-100000@peter.localdomain
Whole thread Raw
In response to Locale and LIKE matching  (Daniel Serodio <daniel@ibnetwork.com.br>)
List pgsql-general
Daniel Serodio writes:

>     Hi! I'd like to know if the LIKE operator is locale-aware when matching
> strings. Specifically, I'd like to have "... LIKE '%a%'" match "á" (á)or
> "ã" (ã) (these are ISO8859-1, pt_BR chars). Is this possible?

No, this is not part of standard locale support, nor the task of the LIKE
operator.  In general, "accent folding" is very situation dependent.

If you look into the pgsql-sql archives a few days back you will find a
link to a function that expands letters into a regular expression that
matches all(?) accented variants of it, which may suit you.

--
Peter Eisentraut      peter_e@gmx.net       http://yi.org/peter-e/


pgsql-general by date:

Previous
From: "ADBAAMD"
Date:
Subject: Re: Locale and LIKE matching
Next
From: "Oliver Elphick"
Date:
Subject: Re: Data access permission?