Re: Locale and LIKE matching

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Daniel Serodio <daniel(at)ibnetwork(dot)com(dot)br>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: Re: Locale and LIKE matching
Date: 2001-03-30 22:04:54
Message-ID: Pine.LNX.4.30.0103310001330.1063-100000@peter.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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 "á" (&aacute;)or
> "ã" (&atilde;) (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(at)gmx(dot)net http://yi.org/peter-e/

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Jeff Eckermann 2001-03-30 22:09:58 RE: dynamic field names in a function.
Previous Message Soma Interesting 2001-03-30 21:58:46 RE: dynamic field names in a function.