Just recently, I've read that PostgreSQL 9.2 is released. My Ubuntu 12.04 has PostgreSQL 9.1.5 installed. How can I update to 9.2 version? I tried apt-get update
and apt-get upgrade
but no updates for PostgreSQL.

- 71,754

- 360
3 Answers
Here's the instructions for adding the postgresql apt repository: https://wiki.postgresql.org/wiki/Apt
Quickstart
Import the repository key from http://apt.postgresql.org/pub/repos/apt/ACCC4CF8.asc:
wget -O - http://apt.postgresql.org/pub/repos/apt/ACCC4CF8.asc | sudo apt-key add -
Edit /etc/apt/sources.list.d/pgdg.list. The distributions are called codename-pgdg. In the example, replace squeeze with the actual distribution you are using:
deb http://apt.postgresql.org/pub/repos/apt/ squeeze-pgdg main
Configure apt's package pinning to prefer the PGDG packages over the Debian ones in /etc/apt/preferences.d/pgdg.pref:
Package: *
Pin: release o=apt.postgresql.org
Pin-Priority: 500
Note: this will replace all your Debian/Ubuntu packages with available packages from the PGDG repository. If you do not want this, skip this step. Update the package lists, and install the pgdg-keyring package to automatically get repository key updates:
sudo apt-get update
sudo apt-get install pgdg-keyring
Once you've added that repository, you can do sudo apt-get install postgresql-9.2

- 431
There is a new, official postgresql.org repository. It contains the newest versions of postgresql including 9.3 as of February 2014. Please read the detailed official instructions. For Ubuntu 12.04 I used:
sudo bash -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ precise-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
sudo apt-get update
sudo apt-get install postgresql-9.3 pgadmin3

- 2,709
-
1What provides the 9.3 version of pg_dump? Dpkg says it's still being provided by postgresql-client-common, which is stuck at 9.1. – Cerin Apr 27 '14 at 02:08
-
-
Ah you're right. But it didn't update the symlinks in /usr/bin, which I'll just have to do manually. – Cerin Apr 27 '14 at 15:58
Try this:
sudo -u postgres psql --cluster 9.2/main

- 13,336

- 23
-
-
On Askubuntu the individual asking a question will see every answer without needing to be individually addressed. Similarly you will be notified of every comment on your answer. Welcome to the site! Do you have any suggestion about Defensor's version error message? – John S Gruber Oct 09 '12 at 19:57
-
1This is just wrong. He's asking how to upgrade, not to connect to a 9.2 cluster. – Edward Anderson Jan 16 '13 at 02:22
-
AS far as I know, ppa:pitti installs the 9.2 in parallel to 9.1 - it just runs on another port. try 'psql -p 5433'. – alfonx Feb 08 '13 at 17:45
Solved it using
– Pankaj Jul 18 '13 at 05:08sudo apt-get remove --purge postgresql-9.2 postgresql-9.1
sudo apt-get install postgresql-9.2