2

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.

3
  • You'd wait until the package is available from the repo, then do yum update. Commented Sep 18, 2012 at 20:23
  • Ah. I wasn't sure if minor releases would show. Thanks @ceejayoz Commented Sep 18, 2012 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 Commented Nov 6, 2012 at 5:03

2 Answers 2

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.

1
0

On the Amazon Linux EC2, you can install the newer version of postgres via

sudo amazon-linux-extras install postgresql12 

To list the Amazon Linux add-on services use the command:

amazon-linux-extras list 

Reference: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/amazon-linux-ami-basics.html#extras-library

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.