Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1XhjPI-00010b-Gs for pgsql-bugs@arkaria.postgresql.org; Fri, 24 Oct 2014 18:16:12 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1XhjPI-0005EY-1L for pgsql-bugs@arkaria.postgresql.org; Fri, 24 Oct 2014 18:16:12 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1XhjPH-0005ES-8i for pgsql-bugs@postgresql.org; Fri, 24 Oct 2014 18:16:11 +0000 Received: from smtp-outbound-1.vmware.com ([208.91.2.12]) by makus.postgresql.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1XhjPD-000133-Vn for pgsql-bugs@postgresql.org; Fri, 24 Oct 2014 18:16:09 +0000 Received: from sc9-mailhost2.vmware.com (sc9-mailhost2.vmware.com [10.113.161.72]) by smtp-outbound-1.vmware.com (Postfix) with ESMTP id 1B26B28633; Fri, 24 Oct 2014 11:16:05 -0700 (PDT) Received: from EX13-CAS-006.vmware.com (EX13-CAS-006.vmware.com [10.113.191.56]) by sc9-mailhost2.vmware.com (Postfix) with ESMTP id CEF1AB15AE; Fri, 24 Oct 2014 11:16:04 -0700 (PDT) Received: from EX13-MBX-024.vmware.com (10.113.191.44) by EX13-MBX-001.vmware.com (10.113.191.21) with Microsoft SMTP Server (TLS) id 15.0.775.38; Fri, 24 Oct 2014 11:16:00 -0700 Received: from [192.168.1.90] (10.113.160.246) by EX13-MBX-024.vmware.com (10.113.191.44) with Microsoft SMTP Server (TLS) id 15.0.775.38; Fri, 24 Oct 2014 11:15:46 -0700 Message-ID: <544A974D.9000002@vmware.com> Date: Fri, 24 Oct 2014 21:15:41 +0300 From: Heikki Linnakangas Organization: VMware User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.1.2 MIME-Version: 1.0 To: Noah Misch , Tom Lane CC: Alon , , "Bruce Momjian" Subject: =?UTF-8?B?UmU6IFtCVUdTXSBSZTogW0JVR1NdIFJlOiBbQlVHU10gUmU6IFtCVUc=?= =?UTF-8?B?U10gUmU6IEJVRyAjMTE0MzE6IEZhaWxpbmcgdG8gYmFja3VwIGFuZCByZXN0b3I=?= =?UTF-8?B?ZSBhIFdpbmRvd3MgcG9zdGdyZXMgZGF0YWJhc2UsIHdpdGggTm9yd2VnaWFuIEI=?= =?UTF-8?B?b2ttw6VsIGxvY2FsZS4=?= References: <20140915230427.2486.29437@wrigleys.postgresql.org> <1411164953375-5819745.post@n5.nabble.com> <20140921051846.GA1565935@tornado.leadboat.com> <7107.1411316005@sss.pgh.pa.us> <20140921180413.GA1585212@tornado.leadboat.com> <54203D19.5020202@vmware.com> <5424090E.9060700@vmware.com> <5437D4CD.8020909@vmware.com> In-Reply-To: <5437D4CD.8020909@vmware.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.113.160.246] X-ClientProxiedBy: EX13-CAS-013.vmware.com (10.113.191.65) To EX13-MBX-024.vmware.com (10.113.191.44) X-Pg-Spam-Score: -8.3 (--------) 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 On 10/10/2014 03:45 PM, Heikki Linnakangas wrote: > On 09/25/2014 03:22 PM, Heikki Linnakangas wrote: >> Alternatively, we could not bother with changing pg_upgrade or CREATE >> DATABASE, and instead instruct Bokmål users to do the manual UPDATE of >> pg_database in the release notes. That might be the most robust >> solution, if there are more cases where we compare locales that I've missed. > > I just realized that pg_upgrade doesn't currently do the > canonicalization when upgrading from a pre-8.4 server. So AFAICS, > upgrading from 8.3 to 9.2-9.4 will fail, if the locale name in the old > cluster doesn't happen to match the canonical form. > > I committed the pg_upgrade patch discussed on the other thread to > master. For the 9.2->9.4 back-branches, I think we should do the > attached > (0001-Make-the-locale-comparison-in-pg_upgrade-more-lenien.patch). This > fixes the problem with 8.3 -> 9.2 upgrades, and prepares pg_upgrade for > the "Norwegian (Bokmål)" -> "norwegian-bokmal" mapping. > > > Now, for the mapping. I thought about it some more, and I think we > really need to provide instructions to fix existing clusters, as part of > the release notes. Even if we do the change to CREATE DATABASE that I > included in my earlier patch, you'll continue to have problems with > different encodings. And initdb writes the values in postgresql.conf > too, for lc_messages et all. Those really should be fixed too. > > So I don't think there's much point in the CREATE DATABASE part. Let's > backpatch the attached patch > (0001-Work-around-Windows-locale-name-with-non-ASCII-chara.patch) and > add the attached instructions to the release notes. > > The UPDATE statements in the instructions are specially crafted to avoid > "invalid byte sequence" errors, if they're run from a database that uses > a different encoding than the one used in the existing rows. I tried > using regexp_replace at first, but tries to decode all the characters, > and fails. I'm not 100% this would work with every encoding, but at > least it works with a mixture of LATIN1 and UTF-8, which are the most > likely encodings to be used with Norwegian. > > These three things together, the pg_upgrade patch, the setlocale() > mapping patch and the release note changes, resolves the issue. Ok, I've committed these patches now. The release note entry needs to be written, with the instructions on updating pg_database. We don't have anywhere to stash release note entries for minor releases, until we actually write the release notes, do we? - Heikki -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs