3

I have a postgres 9.2 database running on debian wheezy. If I execute in pgadmin:

CREATE COLLATION en ( LOCALE = 'en_US.UTF-8')

I get the following error message.

ERROR:  could not create locale "en_US.UTF-8": Datei oder Verzeichnis nicht gefunden
DETAIL:  The operating system could not find any locale data for the locale name "en_US.UTF-8".

I already configured locals on that machine and restarted postgres:

locale-gen en_US.UTF-8
Generating locales (this might take a while)...
  de_DE.UTF-8... done
  en_US.UTF-8... done
  fr_FR.UTF-8... done
  tr_TR.UTF-8... done

But the error is still there. Is there anything else I need to check?

1
  • you may need to restart the postgres service Commented Nov 16, 2020 at 21:40

1 Answer 1

1

Your basic problem is that PostgreSQL uses operating system locales and collation orders.

On Debian, you need to run the following to add the locale:

dpkg-reconfigure locales

Then once en_US.UTF-8 is there it should work.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.