If you run on the Amazon cloud, it's tempting to use
Amazon's own Linux distro. One might expect it to be built to run well on the platform, and also the updates will be close at hand and not incur any traffic charges. However, they seem to have made a major blunder in packaging PostgreSQL.
I found out about this when a very angry user came on the IRC channel yesterday. He had done a "yum update" and suddenly found that his database would not work. He shared the log with us, and here's a small excerpt from it:
---> Package postgresql9-server.x86_64 0:9.1.5-1.23.amzn1 will be obsoleted
---> Package postgresql9-upgrade.x86_64 0:9.2.1-1.28.amzn1 will be obsoleting
--> Processing Dependency: postgresql9-server(x86-64) = 9.2.1-1.28.amzn1 for package: postgresql9-upgrade-9.2.1-1.28.amzn1.x86_64
Wow. They are upgrading the postgres-server package from 9.1 to 9.2, on a simple "yum update". That is just awful. You don't get anything like that happening on any other RPM-based system I know of, certainly not on any RedHat or SUSE derived system I have ever seen. "yum update" should not be doing this sort of thing.
I suspect that it's happened because the Amazon packagers don't actually understand PostgreSQL version numbering. The have two collections of packages, one with "postgres8" and one with "postgres9" as the prefix. But as most (I hope) PostgreSQL users know, our major version numbers have two parts, not one, as can be seen in the
versioning policy Upgrading to a new major version via a simple "yum update" is a totally bad thing to be doing.
Apparently it has caused enough problems for them to have issued an
FAQ about it. But really, that's no answer. This is exactly the sort of thing you should NOT have to do after a simple "yum update". pg_upgrade is not guaranteed to work in all circumstances, and if it fails in one of the many ways it can fail, the user will be left scrambling.
What's really annoying about this is that users are just as likely to blame Postgres for this mess as they are to blame Amazon.
I don't know who to contact at Amazon to urge them to fix this mess, so I've written this in the hope it might help someone who encounters the problem. And for now I am going to advise customers and others to avoid using this. There are
lots of other AMIs that can be used on Amazon. If you must use Amazon Linux, I suggest using the PostgreSQL community yum repos, although this probably requires a tiny bit of work to start with: see
how I did this before we got support for ScientificLinux