Thread: "Invalid multibyte character for locale" still there
Hi, I want to report a bug on PG 8.0 (linux : Fedora Core 3) A LIKE '%langage C%' in the WHERE clause of my SELECT statement gives "invalid multibyte character for locale" error. I thought the bug https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=113231 was fixed and the patch was incorporated in the mainstream. Details ------- In initdb.i18n I have LANG="en_US" (I tried also LANG="en_US.UTF-8") rpm -q postgresql gives postgresql-8.0.0-1PGDG (it's the official postgresql SRPM that rebuilt with default options). On /etc/sysconfig/i18n I have tried LANG="en_US" and LANG="en_US.UTF-8" as well. Real Query ---------- SELECT t0.id_profile, t0.first_name, t0.last_name, t0.email, t0.experience, t0.study_level, t0.study_type, t0.compet_type1, t0.compet_type2, t0.compet_type3, t0.empl_type, t0.avail_type, t0.prof_salary, t0.comments, t1.srcfileid FROM cv_profiles t0 LEFT JOIN cv_profiles_ocr t1 ON (t0.id_profile = t1.id_profile) WHERE (( upper(t1.ocrcontent) LIKE upper('%langage C%') ) ) ORDER BY t0.last_name, t0.first_name; Questions --------- 1. What can I do to outcome this issue (known workarounds, etc.)? 2. Will it be adressed on PG 8.0.1 ? Thanks, Marian
Marian POPESCU <softexpert@libertysurf.fr> writes: > I want to report a bug on PG 8.0 (linux : Fedora Core 3) > A LIKE '%langage C%' in the WHERE clause of my SELECT statement gives > "invalid multibyte character for locale" error. > I thought the bug > https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=113231 was fixed > and the patch was incorporated in the mainstream. That bug was certainly fixed long ago, which means that whatever you have is some other bug. Unfortunately, you haven't given nearly enough information to let anyone else replicate the error. Please send a *self contained* test case --- that includes table declarations and test data. See the bug reporting guidelines in the documentation. regards, tom lane
Marian POPESCU <softexpert@libertysurf.fr> writes: > I put up a testcase at > http://perso.netpratique.fr/softexpert/pgsql/unicodetest.data.gz After experimenting, the only case in which I could get that failure was to deliberately force a database encoding incompatible with the locale, namely initdb with LC_ALL=en_US (which is implicitly Latin1 on FC3) and then "createdb -E unicode". So I think this is pilot error. You need to be careful to use a database encoding consistent with the locale setting. (In 8.0, initdb should usually get this right if you don't override it.) regards, tom lane