2

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.

3 Answers 3

1

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".

1
  • Ok, solved with a bit more work. After the proposed solution I had to manually remove the service and the packages for 8.3. sudo service postgresql-8.3 stop; sudo apt-get purge postgresql-8.3 Change che configuration file for 8.4 to 5432 port and restart the service. Thanks a lot!
    – napolux
    Jan 13, 2010 at 12:40
0

To remove 8.3:

sudo apt-get remove postgresql-8.3

To change 8.4 port, edit /etc/postgresql/8.4/main/postgresql.conf, there should be this line:

port = 5433
3
  • What he said, plus sudo service postgresql-8.4 restart at the end.
    – Tobu
    Jan 11, 2010 at 11:37
  • Not working, I've tryed to remove version 8.3, but it seems that there's still something on port 5432 and changing 8.4 configuration doesn't succeed. Of course nothing is listening on that port. :(
    – napolux
    Jan 11, 2010 at 11:47
  • Would you please show us the error messages? :)
    – Joril
    Jan 11, 2010 at 21:19
0
sudo dpkg --purge postgresql-8.3

then just comment out the port line in the 8.4 configuration

sudo vi /etc/postgresql/8.4/main/postgresql.conf
#port = 5433

and restart postgresql-8.4

sudo /etc/init.d/postgresql restart

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .