Linux – Postgres 8.3 and 8.4 in Ubuntu 9.10

databaselinuxpostgresqlUbuntu

After upgrading to Ubuntu 9.10 I've got 2 istances of Postgres DB on my system: a running 8.4 on port 5433 and the original 8.3 from old distribution stopped on port 5432.

I tryed to change preferences on 8.4 to set the default port, but nothing works.

How can I remove 8.3 and make the 8.4 version the only server on my system and make it run on port 5432?

Thanks in advance.

Best Answer

The port was moved because the 8.3 service wasn't removed first. You can completely remove it (and the data in your old databases) and re-install 8.4 with this:

sudo sh -c "service postgresql-8.3 stop ; apt-get purge postgresql* && apt-get install postgresql-8.4* && service postgresql-8.4 start"

WARNING ~ WARNING ~ WARNING

Note the purge keyword in the apt-get, it will remove any and all existing files AND data for both database instances, so be forewarned that your databases will be deleted along with the program. Make a backup of your data before proceeding!!!

If you don't want to loose the data but do want to ditch the program, replace "purge" with "remove".