Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TGJDN-0008K7-01 for pgsql-hackers@postgresql.org; Tue, 25 Sep 2012 00:41:29 +0000 Received: from mail-pa0-f46.google.com ([209.85.220.46]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TGJDK-0001Sx-MZ for pgsql-hackers@postgresql.org; Tue, 25 Sep 2012 00:41:28 +0000 Received: by padhz1 with SMTP id hz1so1263556pad.19 for ; Mon, 24 Sep 2012 17:41:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=1/6QlknSOyXxQiD7EnmiGAHyMxPpLc7K0jdT/MSZfR4=; b=sJQZXEst7zTGbvR73kUSy/z5xeHhLcqWicgKw32RsI6eJMx2NZSSRglOnBsLgH9A0j RrV9oP42B2BIpGWtsqK3wK+xhqRXkfwem6dNv4hh5IzqzQGabO8D18o+/koJkpY9DilA AWZPz1DVT9ug/avle2aiHn2fVZjshx666x7qKI+GhXkx5Ri6GHVaWKdatuMK9w1O0np6 MK4vZrvLFTSx6WvpyyXGnKvEGS8z9BNG5U+8w2jRJx+O2I1t4gNj4Yi6G8AzhSqpYL48 JPTXdKgYfQsxJZDbpDAWfoHMO5gt8H1HH0AXGUrgLQqBJ/bs5KGKSRPwK5hOiQ6dhu2f xMyg== Received: by 10.66.74.164 with SMTP id u4mr18516373pav.70.1348533685211; Mon, 24 Sep 2012 17:41:25 -0700 (PDT) Received: from [192.168.1.2] ([116.226.32.153]) by mx.google.com with ESMTPS id it6sm10401737pbc.14.2012.09.24.17.41.22 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 24 Sep 2012 17:41:24 -0700 (PDT) Message-ID: <5060FDAF.8020407@gmail.com> Date: Tue, 25 Sep 2012 08:41:19 +0800 From: Rural Hunter User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:15.0) Gecko/20120907 Thunderbird/15.0.1 MIME-Version: 1.0 To: Bruce Momjian CC: Peter Eisentraut , PostgreSQL-development , Tom Lane Subject: Re: [ADMIN] pg_upgrade from 9.1.3 to 9.2 failed References: <20120917210723.GA30394@momjian.us> <20120918232239.GA2014@momjian.us> <505C307E.20501@gmail.com> <1348403628.18490.1.camel@vanquo.pezone.net> <505F1A98.9090901@gmail.com> <1348440393.18490.2.camel@vanquo.pezone.net> <20120924125500.GA21242@momjian.us> <50606726.3050802@gmail.com> <20120924142659.GC21242@momjian.us> <5060720E.1080903@gmail.com> <20120924145731.GE21242@momjian.us> In-Reply-To: <20120924145731.GE21242@momjian.us> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Pg-Spam-Score: -2.7 (--) X-Archive-Number: 201209/919 X-Sequence-Number: 213947 于 2012/9/24 22:57, Bruce Momjian 写道: > On Mon, Sep 24, 2012 at 10:45:34PM +0800, Rural Hunter wrote: >>> If your operating system locale/encoding names changed after the initdb >>> of the old cluster, this would not be reflected in template0. >> No. It's not changed. look at my system settings: >> LANG=zh_CN.UTF-8 >> $ cat /var/lib/locales/supported.d/local >> zh_CN.UTF-8 UTF-8 >> >> I think the problem is on the options when I installed pgsql(both >> 9.1 and 9.2) >> Select the locale to be used by the new database cluster. >> >> Locale >> >> [1] [Default locale] >> [2] C >> [3] POSIX >> [4] zh_CN.utf8 >> [5] zh_HK.utf8 >> [6] zh_SG.utf8 >> [7] zh_TW.utf8 >> Please choose an option [1] : 4 >> I chose 4 instead of 1. I guess the default locale(option 1) is with dash. > Well, if you run that query on template0 in the old and new cluster, you > will see something different in the two of them. Could you have used > default in one and a non-dash in the other. Yes, that's true. The upgrade is fine with both fresh installs(9.1 and 9.2) with option above(without-dash). The problem only happens when I inited the 9.2 db with default locale(I guess that one has the dash). Just wondering why pg installer provides options without dash. > Did we change the way we > canonicalize the locale between 9.1 and 9.2? > > I can send you a patch to test if the setlocale canonicalization works. > Can you test it if I send it? >