Installing Postgres 9.0 onto Amazon EC2 Linux
Amazon EC2 Linux is based on a customised version of Redhat Enterprise Linux, but sadly they do not seem to have Postgres 9.0 available from their Yum repositories. However with a bit of fiddling around I was able to get it to install, so I have reproduced the details here for everyone else.
1) Download and install the appropriate YUM repository configuration from here - http://yum.pgrpms.org/reporpms/repoview/pgdg-redhat.html
$ wget http://yum.pgrpms.org/reporpms/9.0/pgdg-redhat-9.0-2.noarch.rpm $ sudo rpm -i pgdg-redhat-9.0-2.noarch.rpm
2) You need to manually edit the Yum repo file that has just been installed for Postgres
9, as otherwise an unknown release version (as far as the Postgres repo is concerned)
will be used, and you wont be able to download and install the packages.
Edit the file /etc/yum.repos.d/pgdg-90-redhat.repo and replace the string “$releasever”
with “6.0”
3) You can now install Postgres 9.0 using Yum.
$ sudo yum install postgresql90-server
4) You can now start up the database
$ sudo /etc/init.d/postgresql-9.0 initdb $ sudo /etc/init.d/postgresql-9.0 start
5) Check that you can login to the server
$ sudo su – postgres -bash-4.1$ psql psql (9.0.4) Type "help" for help. postgres=#
Done :-)
Adam Retter posted on Saturday, 9th July 2011 at 16.02 (GMT+02:00)
Updated: Saturday, 9th 2011 at July 16.02 (GMT+02:00)