Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 8E8791336971 for ; Wed, 2 Mar 2011 12:01:00 -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 22881-10 for ; Wed, 2 Mar 2011 16:00:53 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from exprod7og126.obsmtp.com (exprod7og126.obsmtp.com [64.18.2.206]) by mail.postgresql.org (Postfix) with ESMTP id 874C51337BD6 for ; Wed, 2 Mar 2011 12:00:52 -0400 (AST) Received: from source ([209.85.215.46]) (using TLSv1) by exprod7ob126.postini.com ([64.18.6.12]) with SMTP ID DSNKTW5ps0NpZGWi4mkbeygha3l3Spnr6Ut3@postini.com; Wed, 02 Mar 2011 08:00:52 PST Received: by ewy6 with SMTP id 6so38613ewy.5 for ; Wed, 02 Mar 2011 08:00:48 -0800 (PST) Received: by 10.213.25.216 with SMTP id a24mr332363ebc.13.1299081648661; Wed, 02 Mar 2011 08:00:48 -0800 (PST) Received: from [192.168.1.183] (dsl-hkibrasgw2-ff7ac300-240.dhcp.inet.fi [88.195.122.240]) by mx.google.com with ESMTPS id q53sm80018eeh.10.2011.03.02.08.00.46 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 02 Mar 2011 08:00:47 -0800 (PST) Message-ID: <4D6E69AD.7080103@enterprisedb.com> Date: Wed, 02 Mar 2011 18:00:45 +0200 From: Heikki Linnakangas User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; fi-FI; rv:1.9.1.16) Gecko/20101226 Icedove/3.0.11 MIME-Version: 1.0 To: depesz@depesz.com CC: pgsql-bugs@postgresql.org Subject: Re: Cannot create collation? References: <20110302125802.GA2003@depesz.com> In-Reply-To: <20110302125802.GA2003@depesz.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-4.2 tagged_above=-5 required=5 tests=BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3 X-Spam-Level: X-Archive-Number: 201103/13 X-Sequence-Number: 29523 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? -- Heikki Linnakangas EnterpriseDB http://www.enterprisedb.com