From: Tom Lane <tgl@sss.pgh.pa.us>
To: alex.shniperson@gmail.com
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #7783: lower & upper function incorrect work
Date: Thu, 03 Jan 2013 17:29:28 -0500
Message-ID: <3144.1357252168@sss.pgh.pa.us> (raw)
In-Reply-To: <E1TqgmD-0007Fs-JZ@wrigleys.postgresql.org>
References: <E1TqgmD-0007Fs-JZ@wrigleys.postgresql.org>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>
alex.shniperson@gmail.com writes:
> PostgreSQL version: 9.1.7
> Operating system: osx lion 10.7.5
> 1) create DataBase with
> ENCODING = 'UTF8'
> LC_COLLATE = 'C'
> LC_CTYPE = 'C'
> 3) insert one simple record with Russian word
> INSERT INTO testtable (id, name) VALUES (1, 'Залог');
> 4) try to select data with upper & lower functions with 'like' operator
> select *, lower(name), upper(name) from testtable where lower(name) like
> '%залог%'
This is not a bug. You specified LC_CTYPE = "C", so upper/lower case
conversion converts only ASCII letters. You need to specify a Russian
locale if you want case conversion to work on Russian letters.
Now having said that, I'm pretty sure that UTF8 locales are completely
broken on OS X, so that this wouldn't work even if you had specified
the right locale. But that's Apple's fault; there's little we can do
about it. I believe locale ru_RU.ISO8859-5 (with the matching encoding)
would behave sanely on OS X, if that's an acceptable fix for you.
regards, tom lane
--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: tgl@sss.pgh.pa.us, alex.shniperson@gmail.com
Subject: Re: BUG #7783: lower & upper function incorrect work
In-Reply-To: <3144.1357252168@sss.pgh.pa.us>
References: <E1TqgmD-0007Fs-JZ@wrigleys.postgresql.org> <3144.1357252168@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox