Re: Yet another problem with ILIKE and UTF-8

From: "Gergely Bor" <borg42(at)gmail(dot)com>
To: "Gregory Stark" <stark(at)enterprisedb(dot)com>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: Yet another problem with ILIKE and UTF-8
Date: 2007-10-25 15:16:04
Message-ID: 396c97310710250816h327fb57ei7c4ea3d6bb72504c@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Hello Gregory,

We'll google the initdb stuff and try it ASAP.

What I've tried is LOWER and UPPER, and they seem to return trash for
Hungarian UTF-8 characters, but they handle ASCII well. (Hmmmm...
maybe ILIKE requires LOWER and UPPER to work? Would not be
illogical...)

Best regards,
Gergely BOR

On 10/25/07, Gregory Stark <stark(at)enterprisedb(dot)com> wrote:
> "Gergely Bor" <borg42(at)gmail(dot)com> writes:
>
> > I have a nasty-looking problem case. Shortly described as follows:
> >
> > INSERT INTO mytable (id, value) VALUES (4242, 'úabcdú');
> > SELECT id FROM mytable WHERE value ILIKE '%abc%';
> >
> > In environment A, the row of the ID just inserted is returned
> > correctly, but in environment B no rows are found. Uh! (Sadly
> > environment B is the productive environment... :/)
> >
> > Notice the UTF-8 chars in the inserted sting and the _lack_ of UTF-8
> > chars in the searched string.
> >
> > Environment A: Win2000, psql 8.2.4, lc_* is C, all encondings (client,
> > server, DB) are UTF-8.
> > Environment B: Debian lenny/sid ^[1], kernel version 2.6.20.1, glibc
> > 2.6.1-5, psql 8.2.5, lc_* is hu_HU, all encondings (client, server,
> > DB) are UTF-8.
>
> I'm not sure this is the right answer but what happens if you initdb a
> database on the Debian box with lc_* set to hu_HU.UTF-8 ?
> (You may have to add it to /etc/locale.gen and rerun locale-gen)
>
> Also, what does lower('úabcdú') return in that locale?
>
> --
> Gregory Stark
> EnterpriseDB http://www.enterprisedb.com
>

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2007-10-25 16:07:31 Re: BUG #3697: utf8 issue: can not reimport a table that was successfully exported.
Previous Message Marc Mamin 2007-10-25 14:49:16 BUG #3697: utf8 issue: can not reimport a table that was successfully exported.