2

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

1 Answer 1

1

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.

1
  • on my ubuntu 18.04 I had to modify the hyphen to underscore and add quotes: sudo locale-gen "en_US.UTF-8"
    – harish
    Sep 11, 2021 at 12:05

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .