Re: unexpected query behavior with UTF text

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Indra Heckenbach <indra(at)macnica(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: unexpected query behavior with UTF text
Date: 2003-10-22 13:58:56
Message-ID: 11056.1066831136@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Indra Heckenbach <indra(at)macnica(dot)com> writes:
> I have recently come across an unusual behavior with Postgres 7.3.4 on a
> Linux RH 9 system. My database has encoding set to "UNICODE", and the
> table includes Japanese text. I'm trying to issue a query like this:

> SELECT * FROM sales WHERE name='ja-text';

> This query ignores all japanese characters in the comparison text. It
> matches properly on ascii chars, but skips right over ja chars.

Text = depends on strcoll(), which is locale-sensitive. It sure appears
that your locale is designed to ignore japanese characters :-(

> I found a related issue on the mailing list, where locale setting was
> causing something similar. However, my locale is set to "en_US.UTF-8",
> which is the solution proposed to the other problem.

We have heard before that RH9's default locale setting is seriously
broken. This seems to be additional evidence for that opinion. I'd
recommend re-initdb'ing in locale C.

Also, you say "your locale", but how certain are you that that is the
database's locale, and not just the one in your own user environment?
It'd be a good idea to use pg_controldata to check the database settings.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Johnson, Shaunn 2003-10-22 14:11:13 Re: how to use pg_resetxlog - closer ...
Previous Message frbn 2003-10-22 13:36:53 Re: Pgsql 7.3.3 on redhat 7.2