Re: BUG #3737: lower/upper fails to match extended chars in LATIN1 - Mailing list pgsql-bugs

From Gregory Stark
Subject Re: BUG #3737: lower/upper fails to match extended chars in LATIN1
Date
Msg-id 87d4ujc5zo.fsf@oxford.xeocode.com
Whole thread Raw
In response to Re: BUG #3737: lower/upper fails to match extended chars in LATIN1  (Heikki Linnakangas <heikki@enterprisedb.com>)
List pgsql-bugs
"Heikki Linnakangas" <heikki@enterprisedb.com> writes:

> Jonas Forsman wrote:
>
>> Try:
>> select * from table where lower(address) like '%=C3=A5%'
>>
>> This select fails to find addresses including capital =C3=85 and similar=
s in
>> LATIN1 (like =C3=85, =C3=84, =C3=96).=20

Isn't =C3 an upper-case letter? In which case lower(address) will never mat=
ch it
since by definition lower(address) will only contain characters which are
lower case. That is if address contains a "=C3" then lower(address) will co=
ntain
an "=E3" instead which won't match the "=C3" in the pattern.

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

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

pgsql-bugs by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Revisiting BUG #3684: After dump/restore, schema PUBLIC always exists
Next
From: Ben Leslie
Date:
Subject: Re: BUG #3735: Can't create xml-stylesheet processing instruction