failing to make LATIN1 on locale C system - what am I doing wrong? - Mailing list pgsql-novice

From marc rassbach
Subject failing to make LATIN1 on locale C system - what am I doing wrong?
Date
Msg-id CAPaK5U9VK0SCbV5biK7GGha3CiKEyF5kTHutPz2V1NqwBDQcyA@mail.gmail.com
Whole thread Raw
Responses Re: failing to make LATIN1 on locale C system - what am I doing wrong?  (Albe Laurenz <laurenz.albe@wien.gv.at>)
List pgsql-novice
Trying to do what maia mailguard says: http://www.maiamailguard.com/maia/wiki/Install
"NOTE: Newer versions of PostgreSQL use UTF8 encoding by default, which is not supported by all of the tools that Maia requires. To avoid encoding errors, PostgreSQL users should use:
pgsql> CREATE DATABASE maia WITH ENCODING 'LATIN1';"


The most popular web-based answer is variations on 'nuke template0 and pick LATIN1'

Yet the postgresql documentation says: https://www.postgresql.org/docs/9.4/static/sql-createdatabase.html
"The character set encoding specified for the new database must be compatible with the chosen locale settings (LC_COLLATE and LC_CTYPE). If the locale is C (or equivalently POSIX), then all encodings are allowed,"

So what am I missing when I do the below and it doesn't work?

$ psql template1
psql (9.4.7)
Type "help" for help.

template1=# CREATE DATABASE music ENCODING 'LATIN1' TEMPLATE template0;
ERROR:  encoding "LATIN1" does not match locale "en_US.UTF-8"
DETAIL:  The chosen LC_CTYPE setting requires encoding "UTF8".
template1-# \q
$ locale
LANG=
LC_CTYPE="C"
LC_COLLATE="C"
LC_TIME="C"
LC_NUMERIC="C"
LC_MONETARY="C"
LC_MESSAGES="C"
LC_ALL=
$ whoami
pgsql

And it "works fine" if I don't try latin1:

$ psql template1
psql (9.4.7)
Type "help" for help.

template1=# CREATE DATABASE music ENCODING 'UTF8' TEMPLATE template0;
CREATE DATABASE
template1=# drop database music;
DROP DATABASE
template1=# \q
$

pgsql-novice by date:

Previous
From: Sameer Kumar
Date:
Subject: What Causes Access Exclusive Lock?
Next
From: Albe Laurenz
Date:
Subject: Re: failing to make LATIN1 on locale C system - what am I doing wrong?