Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id ED85D1337B39 for ; Wed, 2 Mar 2011 12:04:05 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 25840-07 for ; Wed, 2 Mar 2011 16:03:58 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from depesz.com (andy.depesz.com [88.198.47.100]) by mail.postgresql.org (Postfix) with ESMTP id 865811336971 for ; Wed, 2 Mar 2011 12:03:58 -0400 (AST) Received: from andy.depesz.com ([88.198.47.100] helo=depesz.com) by depesz.com with esmtpa (Exim 4.72) (envelope-from ) id 1PuoWq-00061z-GD; Wed, 02 Mar 2011 17:03:56 +0100 Date: Wed, 2 Mar 2011 17:03:56 +0100 From: hubert depesz lubaczewski To: Heikki Linnakangas Cc: pgsql-bugs@postgresql.org Subject: Re: Cannot create collation? Message-ID: <20110302160356.GA20915@depesz.com> Reply-To: depesz@depesz.com References: <20110302125802.GA2003@depesz.com> <4D6E69AD.7080103@enterprisedb.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <4D6E69AD.7080103@enterprisedb.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-5 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201103/14 X-Sequence-Number: 29524 On Wed, Mar 02, 2011 at 06:00:45PM +0200, Heikki Linnakangas wrote: > On 02.03.2011 14:58, hubert depesz lubaczewski wrote: > >When I try to create french collation, it seems to work, but fails soon: > > > >$ CREATE COLLATION french (LOCALE = 'fr_FR.UTF-8'); > >CREATE COLLATION > > Hmm, regardless of what's causing this, I wonder if we should check > that the locale works at CREATE COLLATION time, rather than fail > when you try to use it. Ie. add a call to > pg_newlocale_from_collation() at the end of DefineCollation(). Or > would that just make it more difficult to restore a database with > invalid collations? > > >$ select * from test3 order by x; > >ERROR: could not create locale "fr_FR.UTF-8": Success > > Looks like newlocale() call returned 0, but didn't set errno. I > don't think that's supposed to happen. Which platform is this? Which > operating system and version? linux ubuntu 10.10. I was missing language-pack-fr and language-support-fr. interestingly, I'm getting weird results. with just language-pack-fr i can order by column, but result is not the one i'd expect. when I added language-support-fr - ordering works, and returns data as expected. weird. Best regards, depesz -- The best thing about modern society is how easy it is to avoid contact with it. http://depesz.com/