I thought this is pretty straightforward, but I decided to write this post after getting a few emails recently.

First, download PostgreSQL 9.2 repo package from here. Please pick up the correct repo file per your distro and architecture. If you are not sure about your OS version, run

cat /etc/redhat-release


Install the repo RPM. For example, if you downloaded repo RPM for RHEL 6, here is your command:

rpm -ivh pgdg-redhat92-9.2-7.noarch.rpm


Alternatively, you can install the package directly by using the repo RPM URL:

rpm -ivh http://yum.postgresql.org/9.2/redhat/rhel-6-x86_64/pgdg-redhat92-9.2-7.noarch.rpm


Now, you can install PostgreSQL 9.2 with single command:

yum groupinstall "PostgreSQL Database Server 9.2 PGDG"


This will install PostgreSQL 9.2 server, along with -contrib subpackage. If you don't want -contrib subpackage, you can use

yum install postgresql92-server


to install 9.2 on your machine. Once it is installed, first initialize the cluster:

service postgresql-9.2 initdb


Now, you can start PostgreSQL 9.2:

service postgresql-9.2 start


If you want PostgreSQL 9.2 to start everytime on boot, run this:

chkconfig postgresql-9.2 on


Enjoy!

9 Comments

Linear

Add Comment

Enclosing asterisks marks text as bold (*word*), underscore are made via _word_.
Standard emoticons like :-) and ;-) are converted to images.

To prevent automated Bots from commentspamming, please enter the string you see in the image below in the appropriate input box. Your comment will only be submitted if the strings match. Please ensure that your browser supports and accepts cookies, or your comment cannot be verified correctly.
CAPTCHA