Install and configure the good locale for a postgresql error on ubuntu 18.04.2

0

Here is my error when i try to use postgresql 10 :

DETAIL: The database was initialized with LC_COLLATE "en_US.UTF-8", which is not recognized by setlocale().

How to configure properly the locales ?

I've try : export LC_COLLATE=en_US.UTF-8

user462794

Posted 2019-03-23T19:13:09.817

Reputation: 109

Answers

0

The message implies that en_US.UTF-8 is not part of the available locales (which can be displayed with locale -a)

To add it: sudo locale-gen en-US.UTF-8

Then PostgreSQL needs to be restarted to pick it up.

If this instance of PostgreSQL has been created by copying a data directory from another machine, you also want to reindex the databases (see reindexb) to account for any change in locales across systems.

Daniel Vérité

Posted 2019-03-23T19:13:09.817

Reputation: 1 225