Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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.

share|improve this question
add comment

3 Answers 3

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

share|improve this answer
    
I already have PostgreSQL installed, doing this will conflict my current installed? –  Defensor Feb 23 '13 at 14:01
    
it will install in it's own folder for postgresql-9.2. If you find some of your commands (like pg_dump) point to postgresql-9.1 programs, you can change the symlink or just run the command from within the postgresql-9.2 directory. definitely back up databases before installing the new version just to be sure. –  Danny Feb 23 '13 at 16:58
1  
I take issue with that deprecation warning, since the PPA goes up to Quantal and the newer repo doesn't. Both are late to Raring, which breaks the recommended script. –  Tobu Apr 22 '13 at 20:55
1  
Just for future reference, I was getting the error saying /var/lib/postgresql/9.2/main is not accessible or does not exist Solved it using sudo apt-get remove --purge postgresql-9.2 postgresql-9.1 sudo apt-get install postgresql-9.2 –  Pankaj Jul 18 '13 at 5:08
    
Note, piping into sudo is not recommended. On my system, that causes the sudo prompt to be hidden, making the entire command appear to hang indefinitely. –  Cerin Apr 27 at 1:54
add comment

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
share|improve this answer
1  
What 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 at 2:08
    
@Cerin package postgresql-client-9.3 contains pg_dump –  geekQ Apr 27 at 10:14
    
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 at 15:58
add comment

Try this:

sudo -u postgres psql --cluster 9.2/main 
share|improve this answer
    
I get this : Error: Invalid version specified with --cluster –  Defensor Sep 12 '12 at 15:25
    
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 9 '12 at 19:57
1  
This is just wrong. He's asking how to upgrade, not to connect to a 9.2 cluster. –  nilbus Jan 16 '13 at 2: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 8 '13 at 17:45
add comment

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.