Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question

3 Answers 3

up vote 1 down vote accepted

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

share|improve this answer
    
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 '10 at 12:40
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
share|improve this answer

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
share|improve this answer
    
What he said, plus sudo service postgresql-8.4 restart at the end. –  Tobu Jan 11 '10 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 '10 at 11:47
    
Would you please show us the error messages? :) –  Joril Jan 11 '10 at 21:19
    
Solved, see above. Thanks however. :) –  Napolux Jan 13 '10 at 12:58

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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