2

Trying to start PostgreSQL, but get the following error:

$ pg_ctl -D postgres_data start
server starting
FATAL:  postmaster became multithreaded during startup
HINT:  Set the LC_ALL environment variable to a valid locale

My locale is set:

LANG="en_US.UTF-8"
LC_COLLATE="C"
LC_CTYPE="C"
LC_MESSAGES="C"
LC_MONETARY="C"
LC_NUMERIC="C"
LC_TIME="C"
LC_ALL="C"

System is MacOS 10.10.5, PostgreSQL version is 9.5.0.

I followed Michael's suggestion. Now the locale values are:

$ locale
LANG="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_CTYPE="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_ALL="en_US.UTF-8"

But the error remains.

I Googled the error message to see if anyone had run into this problem, but did not see a solution.

1

Your locale is mis-set.

You have LANG defined as en_US.UTF-8, but everything else is defined as C. These are rather different, and mixing them will cause all sorts of weirdness.

Do what the error message told you: set LC_ALL to the correct locale (and set all the rest of them too).

  • I know little about locales. Is the correct locale "en_US.UTF-8"? Note that I didn't explicitly set any of those variables - that is what MacOS did. It has a "Language and Region" system preference which apparently does not set the LC_* stuff. – Craig S. Anderson Jan 22 '16 at 18:07
  • That depends. Do you speak English and are in the US? – Michael Hampton Jan 22 '16 at 18:09
  • Yes - the LANG is correct. – Craig S. Anderson Jan 22 '16 at 18:12
  • When I run locale on El Capitan, they are all set correctly. If you need help with setting these, you should do so elsewhere, such as Super User or Ask Different. That really isn't on topic here. – Michael Hampton Jan 22 '16 at 18:14
0

I have resolved the issue for My Mac running Postgres 9.5 and 9.6 by setting LC_ALL for the 'postgres' account.

See details on https://github.com/PostgresApp/PostgresApp/issues/317#issuecomment-251786830

  • Where is the 'postgres' account located? – aboutaaron Mar 14 '17 at 15:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.