Re: BUG #3737: lower/upper fails to match extended chars in LATIN1

From: Gregory Stark <stark(at)enterprisedb(dot)com>
To: "Heikki Linnakangas" <heikki(at)enterprisedb(dot)com>
Cc: "Jonas Forsman" <jonas(at)axier(dot)org>, <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: BUG #3737: lower/upper fails to match extended chars in LATIN1
Date: 2007-11-10 00:13:31
Message-ID: 87d4ujc5zo.fsf@oxford.xeocode.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs


"Heikki Linnakangas" <heikki(at)enterprisedb(dot)com> writes:

> Jonas Forsman wrote:
>
>> Try:
>> select * from table where lower(address) like '%Ã¥%'
>>
>> This select fails to find addresses including capital Ã… and similars in
>> LATIN1 (like Å, Ä, Ö).

Isn't à an upper-case letter? In which case lower(address) will never match it
since by definition lower(address) will only contain characters which are
lower case. That is if address contains a "Ã" then lower(address) will contain
an "ã" instead which won't match the "Ã" in the pattern.

I think you either need to put a lower() on both sides of the LIKE or use
ILIKE.

--
Gregory Stark
EnterpriseDB http://www.enterprisedb.com
Get trained by Bruce Momjian - ask me about EnterpriseDB's PostgreSQL training!

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Ben Leslie 2007-11-10 02:43:23 Re: BUG #3735: Can't create xml-stylesheet processing instruction
Previous Message Bruce Momjian 2007-11-09 23:45:57 Re: Revisiting BUG #3684: After dump/restore, schema PUBLIC always exists