Thursday, 22 November 2007

Installing Postgresql 8.2 on 7.10 server

Installing Postgresql 8.2 was tricky. The database did not start automatically. The directory /etc/postgresql was not created by the installation scripts of the package.

In a previous version of this blog I complained that Ubuntu developers would ignore the problem.

Martin Pitt pointed out that the problem had something to do with my settings of locale. It turns out that the installation script checks very stringently for a correct setting of the locales. Otherwise it would simply terminate the installation process.

locales showed a correct list of locale settings.

Martin suggested to use the following command:
sudo locale-gen de_AT.UTF-8 en_US.UTF-8
On my test machine this changed nothing (obvious). Only when Martin explained why he insisted on the locales (setting the character set and collation sequence in tables) did I follow his advice and reset the locales.

Reinstallation postgresql 8.2 worked finally, the database started automatically.

Kudos to Martin Pitt for having the patience putting up with me. Martin, I am sorry.

To set up you database server you first need to:
  • edit postgresql.conf configuration file and set
    listen_addresses = '*'
  • edit pg_hba.conf host based authentication configuration, add
    hostssl all all 0.0.0.0 0.0.0.0 md5
    to the end of the file to allow all clients to connect to the database
  • restart the database server with
    /etc/init.d/postgresql-8.2 restart
I installed pgadmin3 on my notebook to access and successfully configure the database. I created a table using webmin for testing purposes.. Finally I tried to connect to my database using MonoDevelop and reconfigured the table to my requirements.

1 comment:

Johnny Darwin said...

Postgresql 8.3 install failing on Ubuntu Gutsy :

8.3 install is behaving similar to 8.2.

Install complains about empty locale settings, as under, and exits (I wonder, if it should abort, display a clean install failed message to help us!)

perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LANG = "en_US.UTF-8"
are supported and installed on your system.


dpkg shows all the Postgresql packages as installed! but I don't see /etc/postgresql and all configuration files, postgresql.conf, pg_hba.conf are missing.

I thank Wolf Rogner for this blog.

Installed Postgresql 8.3 on Ubuntu Gutsy successfully :)