Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have an Amazon EC2 instance running PostgreSQL 9.1. I am pointing to the RedHat repo for PostgreSQL. Now that 9.2 is out, how do I upgrade? This is new to me.

share|improve this question
    
You'd wait until the package is available from the repo, then do yum update. –  ceejayoz Sep 18 '12 at 20:23
    
Ah. I wasn't sure if minor releases would show. Thanks @ceejayoz –  B5Fan74 Sep 18 '12 at 20:25
    
@ceejayoz Actually, the Amazon packaging for PostgreSQL is dangerously wrong, and can result in an unusable DB if you just update. It updates from 9.1 to 9.2 without pg_upgrade or a dump and reload. See people.planetpostgresql.org/andrew/index.php?/archives/… and Amazon's "answer" here: aws.amazon.com/amazon-linux-ami/faqs/#postgresql9 –  Craig Ringer Nov 6 '12 at 5:03

1 Answer 1

  1. You can use the PGDG repo RPMs available here (just wget and rpm -i). Then, you should probably use pg_dump[all] to snapshot your databases/clusters, verify the dumps, uninstall the old version of Postgres, and install the new version. Restore the dumps, and you're good to go.

  2. For a slightly faster alternative (which I haven't used), you could use the upgrade utilities that I hear are available via the postgresql-contrib packages to perform the above process in an automated/managed fashion.

  3. A third alternative, if downtime is absolutely unacceptable during an upgrade dump/restore, is to start a second instance of Postgres (the new version), and replicate your data from the old to the new using Slony or similar. That will probably not be easy to set up, however. I'd suggest just scheduling some maintenance, and using option 1 or 2.

share|improve this answer
    
pg_upgrade is probably the tool you're talking about. If so, it works completely differently to (1), doing an in-place upgrade. See postgresql.org/docs/current/static/pgupgrade.html –  Craig Ringer Nov 6 '12 at 5:03

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.