How can I reinstall Postgres to change locale for which it was installed?

78 views Asked by At

I am really new to Postgres so sorry if it an easy/stupid question.

I switched from Postgres 10 to 15 by doing the following:

  1. Installed PostgreSQL 15
  2. Stoped the 15 cluster and drop it
  3. Upgraded 10 cluster to the latest version
  4. Dropped 10 cluster
  5. Restarted PostgreSQL
  6. Uninstall PostgreSQL 10

Now I actually found that I needed to have another locale configured on my server and it needed to be done before installation.

How would it be correct to change the locale? Should I unistall Postgress at all or:

  1. Reinstall 10 first
  2. Delete 15
  3. Change the locale
  4. install 15 as I did before

Or is it necessary to change the locale before installation at all?

Edit: When I was upgrading ver 10, I got an error:

sudo pg_upgradecluster 10 main
Stopping old cluster...
Restarting old cluster with restricted connections...
Notice: extra pg_ctl/postgres options given, bypassing systemctl for start operation
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
    LANGUAGE = (unset),
    LC_ALL = (unset),
    LC_CTYPE = "UTF-8",
    LANG = "en_US.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to a fallback locale ("en_US.UTF-8").
Error: The locale requested by the environment is invalid:
  LANG: en_US.UTF-8
  LC_CTYPE: UTF-8
Error: Could not create target cluster

I have been told that this locale is wrong for my server and it should be changed before installation of Postgres.

0

There are 0 answers