Monday, September 17, 2012

Install pgAdmin for PostgreSQL 9.2 on Ubuntu 12.04


The Ubuntu 12.04 package manager will install pgadmin3 version 1.14 which does not support PostgreSQL 9.2.

Warning:
The server you are connecting to is not a version that is supported by this release of pgAdmin III.
pgAdmin III may not function as expected.
Supported server versions are 8.2 to 9.1.

Remove the current pgAdmin version


sudo apt-get remove pgadmin3


Install pgAdmin version 1.16 using a ppa


sudo apt-add-repository ppa:voronov84/andreyv
sudo apt-get update
sudo apt-get install pgadmin3


Update: If you are having trouble with the method above (see comments below) try the .deb install.

pgAdmin 1.16 (amd64)
pgAdmin 1.16 (i386)


Saturday, September 15, 2012

Replace PostgreSQL 9.1 with 9.2 in Ubuntu 12.04

Recently released PostgreSQL 9.2 comes with a heap of new features and improvements over 9.1.

These are the steps I took to remove 9.1 and install PostgreSQL 9.2 in Ubuntu 12.04.

Warning: This procedure is suitable for test and development environments only as it will wipe out all 9.1 databases


1. List currently installed postgres packages


sudo dpkg -l | grep postgres


2. Remove postgresql-9.1

*these packages were on my system

sudo apt-get --purge remove postgresql postgresql-9.1 postgresql-client-9.1 postgresql-client-common postgresql-common postgresql-doc postgresql-doc-9.1


3. Install postgresql-9.2 with official ppa


sudo add-apt-repository ppa:pitti/postgresql
sudo apt-get update
sudo apt-get install postgresql-9.2

If you cannot add the repository
sudo: add-apt-repository: command not found

Install this package

sudo apt-get install python-software-properties


4. Check postgresql is set to the default port 5432


sudo netstat -lp | grep postgresql


5. Reset to default port if necessary


sudo gedit /etc/postgresql/9.2/main/postgresql.conf

port = 5432 *change the port value in the conf file

sudo /etc/init.d/postgresql reload


6. Setup your project database / user and database.yml


PostgreSQL Setup for Rails Development (skip to step 2)