Received: from magus.postgresql.org ([87.238.57.229]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TG8MX-0001tZ-51 for pgsql-hackers@postgresql.org; Mon, 24 Sep 2012 13:06:13 +0000 Received: from eisentraut.org ([85.214.91.16] helo=gattler.pezone.net) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TG8MS-0007a9-BN for pgsql-hackers@postgresql.org; Mon, 24 Sep 2012 13:06:12 +0000 Received: from jesse.mybdev.com (unknown [204.145.120.11]) by gattler.pezone.net (Postfix) with ESMTPSA id 43A175A8017; Mon, 24 Sep 2012 13:06:06 +0000 (UTC) Message-ID: <50605ABC.1000304@gmx.net> Date: Mon, 24 Sep 2012 09:06:04 -0400 From: Peter Eisentraut User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:15.0) Gecko/20120907 Thunderbird/15.0.1 MIME-Version: 1.0 To: Bruce Momjian CC: Rural Hunter , PostgreSQL-development , Tom Lane Subject: Re: [ADMIN] pg_upgrade from 9.1.3 to 9.2 failed References: <20120916171746.GA24907@momjian.us> <28666.1347833056@sss.pgh.pa.us> <20120917043236.GA20123@momjian.us> <5056AF29.3040903@gmail.com> <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> In-Reply-To: <20120924125500.GA21242@momjian.us> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201209/870 X-Sequence-Number: 213898 On 9/24/12 8:55 AM, Bruce Momjian wrote: > I can confirm that pg_upgrade does case-insensitive comparisons of > encoding/locale names: > > static void > check_locale_and_encoding(ControlData *oldctrl, > ControlData *newctrl) > { > /* These are often defined with inconsistent case, so use pg_strcasecmp(). */ > if (pg_strcasecmp(oldctrl->lc_collate, newctrl->lc_collate) != 0) > pg_log(PG_FATAL, > "old and new cluster lc_collate values do not match\n"); > if (pg_strcasecmp(oldctrl->lc_ctype, newctrl->lc_ctype) != 0) > pg_log(PG_FATAL, > "old and new cluster lc_ctype values do not match\n"); I seem to recall that at some point in the distant past, somehow some Linux distributions changed the canonical spelling of locale names from xx_YY.UTF-8 to xx_YY.utf8. So if people are upgrading old PostgreSQL instances that use the old spelling, pg_upgrade will probably fail. A fix might be to take the locale name you find in pg_control and run it through setlocale() to get the new canonical name.