Upgrade postgresql-8.4 to postgresql-9.1

Tuesday, November 22, 2011

install postgresql 9.1 on ubuntu via apt-get

1, back up your databases

 ~ pg_dumpall > outputfile

2, add postgresql apt repository

~ sudo add-apt-repository ppa:pitti/postgresql

3, remove postgresql-8.4

~ sudo apt-get remove postgresql-8.4

4, update apt source index

~ sudo apt-get update

5, install postgresql-9.1

~ sudo apt-get install postgresql-9.1

6, create new user for postgres

~ sudo -u postgres sh
[sudo] password for eric: 
$ createuser -P eric
Enter password for new role: 
Enter it again: 
Shall the new role be a superuser? (y/n) y
$ exit

7, restore your data from backup

~ psql -d postgres -f outputfile


This entry was tagged PostgreSQL and ubuntu

comments powered by Disqus

© 2009-2013 lxneng.com. All rights reserved. Powered by Pyramid

go to Top