Skip to content

Instantly share code, notes, and snippets.

@BartlomiejSkwira
Created September 3, 2013 13:29
Show Gist options
  • Select an option

  • Save BartlomiejSkwira/6423932 to your computer and use it in GitHub Desktop.

Select an option

Save BartlomiejSkwira/6423932 to your computer and use it in GitHub Desktop.
upograding postgres
sudo add-apt-repository ppa:pitti/postgresql
sudo apt-get update
sudo apt-get install postgresql-9.2 postgresql-server-dev-9.2 postgresql-contrib-9.2
https://wiki.postgresql.org/wiki/Apt
sudo su -l postgres
psql -d template1 -p 5433
CREATE EXTENSION IF NOT EXISTS hstore;
CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
#as admin
service postgresql stop
#as postgres
/usr/lib/postgresql/9.2/bin/pg_upgrade -b /usr/lib/postgresql/9.1/bin -B /usr/lib/postgresql/9.2/bin -d /var/lib/postgresql/9.1/main/ -D /var/lib/postgresql/9.2/main/ -O "-c config_file=/etc/postgresql/9.2/main/postgresql.conf" -o "-c config_file=/etc/postgresql/9.1/main/postgresql.conf"
logout # logout postgresql back to previous user
sudo apt-get remove postgresql-9.1
sudo vim /etc/postgresql/9.2/main/postgresql.conf # change port to 5432
sudo service postgresql restart
#port 5433 w database.yml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment