Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cTtrG-0003ak-L5 for pgsql-committers@arkaria.postgresql.org; Wed, 18 Jan 2017 17:17:14 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1cTtrF-0002U2-Uv for pgsql-committers@arkaria.postgresql.org; Wed, 18 Jan 2017 17:17:13 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1cTtr2-0002Ev-8F for pgsql-committers@postgresql.org; Wed, 18 Jan 2017 17:17:00 +0000 Received: from [2600:3c02::f03c:91ff:fe70:c491] (helo=apinaye.timbira.com.br) by magus.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cTtqv-0004Br-ID for pgsql-committers@postgresql.org; Wed, 18 Jan 2017 17:16:59 +0000 Received: by apinaye.timbira.com.br (Postfix, from userid 110) id E3F10119EE; Wed, 18 Jan 2017 15:16:51 -0200 (BRST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on apinaye X-Spam-Level: X-Spam-Status: No, score=-100.2 required=4.5 tests=ALL_TRUSTED,BAYES_00, DNS_FROM_AHBL_RHSBL,URIBL_BLOCKED,USER_IN_WHITELIST autolearn=no version=3.3.1 Received: from [10.3.2.23] (unknown [179.155.143.198]) by apinaye.timbira.com.br (Postfix) with ESMTPSA id 1C46C119E5; Wed, 18 Jan 2017 15:16:50 -0200 (BRST) Subject: Re: pgsql: Add function to import operating system collations To: Tom Lane , Peter Eisentraut References: <26116.1484751196@sss.pgh.pa.us> <2083.1484754187@sss.pgh.pa.us> Cc: pgsql-committers@postgresql.org From: Euler Taveira Organization: Timbira Message-ID: <1692a47a-4eb9-d162-b3fd-14c4b109a368@timbira.com.br> Date: Wed, 18 Jan 2017 14:16:48 -0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Icedove/45.5.1 MIME-Version: 1.0 In-Reply-To: <2083.1484754187@sss.pgh.pa.us> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit X-Host-Lookup-Failed: Reverse DNS lookup failed for 2600:3c02::f03c:91ff:fe70:c491 (failed) X-Pg-Spam-Score: -1.1 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-committers Precedence: bulk Sender: pgsql-committers-owner@postgresql.org On 18-01-2017 12:43, Tom Lane wrote: > I wrote: >> running bootstrap script ... ok >> performing post-bootstrap initialization ... 2017-01-18 09:49:45.019 EST [25919] FATAL: collation "aa_ER@saaho" for encoding "UTF8" already exists >> 2017-01-18 09:49:45.019 EST [25919] STATEMENT: SELECT pg_import_system_collations(if_not_exists => false, schema => 'pg_catalog'); > > As a stopgap so I could get some work done, I did > > - PG_CMD_PUTS("SELECT pg_import_system_collations(if_not_exists => false, schema => 'pg_catalog');\n\n"); > + PG_CMD_PUTS("SELECT pg_import_system_collations(if_not_exists => true, schema => 'pg_catalog');\n\n"); > > and what I now see in pg_collation is > > regression=# select * from pg_collation where collname like 'aa_ER%'; > collname | collnamespace | collowner | collencoding | collcollate | collctype > ------------------+---------------+-----------+--------------+------------------+------------------ > aa_ER | 11 | 10 | 6 | aa_ER | aa_ER > aa_ER.utf8 | 11 | 10 | 6 | aa_ER.utf8 | aa_ER.utf8 > aa_ER.utf8@saaho | 11 | 10 | 6 | aa_ER.utf8@saaho | aa_ER.utf8@saaho > aa_ER@saaho | 11 | 10 | 6 | aa_ER.utf8@saaho | aa_ER.utf8@saaho > (4 rows) > > Maybe an appropriate fix would be to ignore collations whose names aren't > equal to what we get for collcollate/collctype. Presumably the latter > are getting canonicalized somehow. > collname 'en_US' seems to be more popular than 'en_US.utf8' (it is shorter). We can't ignore locales without .utf8 or @something because it would break queries with COLLATE clause. Ignore collations at initdb time seems to fix the error. However, do collations remain the same as 9.6? -- Euler Taveira Timbira - http://www.timbira.com.br/ PostgreSQL: Consultoria, Desenvolvimento, Suporte 24x7 e Treinamento -- Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-committers