2

So I want to set up Postgres on a Microsoft Azure-server running Ubuntu 14.04. I need to make a cluster:

user@mysystem:~$ pg_createcluster
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
    LANGUAGE = (unset),
    LC_ALL = (unset),
    LC_PAPER = "nb_NO.UTF-8",
    LC_ADDRESS = "nb_NO.UTF-8",
    LC_MONETARY = "nb_NO.UTF-8",
    LC_NUMERIC = "nb_NO.UTF-8",
    LC_TELEPHONE = "nb_NO.UTF-8",
    LC_IDENTIFICATION = "nb_NO.UTF-8",
    LC_MEASUREMENT = "nb_NO.UTF-8",
    LC_TIME = "nb_NO.UTF-8",
    LC_NAME = "nb_NO.UTF-8",
    LANG = "en_US.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
Error: The locale requested by the environment is invalid.

What I've tried:

  • Adding LANG=en_US.UTF-8 to /etc/environment
  • Running sudo locale-gen en_US.UTF-8 (and also with my own typeset, norwegian)

After much googling I've found this question and answer, which is the same situation as I have. The problem is that none of the suggestions in the accepted answer works for me, but I think that it may be that the problem pointed out with the typeset differing from my host and the Azure cloud-machine, may be the source of the problem. I haven't found anything to help me with this yet.

Note that the perl-warning comes with other Postgres-related commands too, including starting the Postgres-server or client-program.

All help is greatly appreciated. Thanks in advance!

Community
  • 1
  • 1
Esso
  • 694
  • 4
  • 8
  • 21

1 Answers1

2

It's because of connection over ssh Add this lines to your .profile or .bashrc

export LC_ALL="nb_NO.UTF-8"
export LANGUAGE="nb_NO.UTF-8"
export LC_CTYPE="nb_NO.UTF-8"
ph4n70m
  • 300
  • 2
  • 6