Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TqtI7-0001Yr-0B for pgsql-bugs@arkaria.postgresql.org; Thu, 03 Jan 2013 22:29:35 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1TqtI6-0002Wp-7K for pgsql-bugs@arkaria.postgresql.org; Thu, 03 Jan 2013 22:29:34 +0000 Received: from makus.postgresql.org ([98.129.198.125]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TqtI5-0002Wh-Bi for pgsql-bugs@postgresql.org; Thu, 03 Jan 2013 22:29:33 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TqtI2-00043J-TH for pgsql-bugs@postgresql.org; Thu, 03 Jan 2013 22:29:32 +0000 Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.5/8.14.5) with ESMTP id r03MTSDA003145; Thu, 3 Jan 2013 17:29:29 -0500 (EST) From: Tom Lane To: alex.shniperson@gmail.com cc: pgsql-bugs@postgresql.org Subject: Re: BUG #7783: lower & upper function incorrect work In-reply-to: References: Comments: In-reply-to alex.shniperson@gmail.com message dated "Thu, 03 Jan 2013 09:07:49 +0000" Date: Thu, 03 Jan 2013 17:29:28 -0500 Message-ID: <3144.1357252168@sss.pgh.pa.us> X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org 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