Locales, Postgresql and Ubuntu

Somewhere along the path of running Ubuntu unstable and its postgresql-8.1 packages, the locale which the main cluster was built with was en_US. But this was not the UTF8 variety of en_US, it was(is) the ISO-8859-1 variety of en_US. Well, somewhere along the way Ubuntu started defaulting to making ONLY the en_US.utf8 locale when the locale package is installed. This lead to some ugly strange errors when trying to start the postgresql server.

Error: The server must be started under the locale en_US which does not exist any more.

It is troubling because the en_US locale DOES exist, and the start scripts automatically set the locale properly. The issues is that en_US.ISO-8859-1 does not exist, but that en_US.UTF8 does exist. The solution is a simple command, but it wasn’t so simple to track down.

sudo apt-get install language-pack-en-base
sudo locale-gen en_US
sudo invoke-rc.d postgresql-8.1 start

2 thoughts on “Locales, Postgresql and Ubuntu”

  1. Hi am on Ubuntu edgy had dapper earlier now updgarded kubuntu-desktop (by changing dapper to edgy in sources.list ) after which i faced a simillar error for postgres

    perl: warning: Please check that your locale settings:
    LANGUAGE = “en_IN:en”,
    LC_ALL = (unset),
    LANG = “en_IN”
    are supported and installed on your system.
    perl: warning: Falling back to the standard locale (“C”).
    Error: The server must be started under the locale en_IN which does not exist any more.

    as you have mentioned in the post i ran those commands and tried sudo locale-gen en_US /en_IN but still the problem persists..

    any advise?

    Thanks in Advance
    Ajo Paul

Comments are closed.