How to upgrade PostgreSQL on EC2?
You can use the PGDG repo RPMs available here (just
wget
andrpm -i
). Then, you should probably usepg_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.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.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.