pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Holger Jakobs <holger@jakobs.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-admin@lists.postgresql.org
Subject: Re: Names of encodings, lc_collate, lc_ctype
Date: Wed, 10 Jul 2019 21:29:59 +0200
Message-ID: <bdb6898d-2c8b-3604-dc5a-f5e52823a34f@jakobs.com> (raw)
In-Reply-To: <810.1562765208@sss.pgh.pa.us>
References: <3da4af02269b44a18b56a070af0bca18@jakobs.com>
	<810.1562765208@sss.pgh.pa.us>

Dear Tom,

After creating the locale with

  sudo locale-gen en_US.UTF-8

and a restart of the PostgreSQL server, it worked.

Thank you.

Holger Jakobs

Am 10.07.19 um 15:26 schrieb Tom Lane:
> Holger Jakobs <holger@jakobs.com> writes:
>>    CREATE DATABASE db1 WITH TEMPLATE = template0 ENCODING = 'UTF8' 
>> LC_COLLATE = 'en_US.UTF-8' LC_CTYPE = 'en_US.UTF-8';
>> which causes trouble on a PostgreSQL 10 or 11 on an Ubuntu 18.04 machine
>>    ungültiger Locale-Name: »en_US.UTF-8«  (meaning 'illegal locale name')
> Hmm, does "locale -a" show that you have en_US installed?
>
> It's basically on the platform's libc to say whether the values for
> LC_COLLATE and LC_CTYPE are valid.  In my experience, glibc is quite
> forgiving about how the encoding suffix is spelled, so I'm wondering
> if your destination machine is simply lacking the locale definition.
>
>> The command
>>    select * from pg_collation;
>> shows (among many others of course)
>>    en_US.utf8
> This doesn't have anything to do with what CREATE DATABASE accepts,
> IIRC.  It does show that when initdb ran, it saw en_US.utf8 reported
> by "locale -a"; but maybe that was in a different environment.
>
>> How come there are encodings/collations/locales with and without hyphen? 
>> Why does the Ubuntu machine not accept a locale which is present in 
>> lc_collation?
> Interesting questions, but you need a glibc expert not a Postgres
> expert.
>
> 			regards, tom lane
-- 

Holger Jakobs, Bergisch Gladbach
instant messaging: xmpp:holger@jakobs.com
+49 178 9759012 <tel:+491789759012> oder +49 2202 817157
<tel:+492202817157>

view thread (4+ messages)

Message-ID: <bdb6898d-2c8b-3604-dc5a-f5e52823a34f@jakobs.com>
Permalink:  ../bdb6898d-2c8b-3604-dc5a-f5e52823a34f@jakobs.com/
Also on:    postgresql.org/message-id/bdb6898d-2c8b-3604-dc5a-f5e52823a34f@jakobs.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: holger@jakobs.com, tgl@sss.pgh.pa.us, pgsql-admin@lists.postgresql.org
  Subject: Re: Names of encodings, lc_collate, lc_ctype
  In-Reply-To: <bdb6898d-2c8b-3604-dc5a-f5e52823a34f@jakobs.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox