Centos 6-5: Install postgreSQL-9.3 via yum and enable pgcrypto

The commands were taken from the official postgreSQL web site.


I just put the commands together. Very easy to install and start. These commands will install postgreSQL 9.3 and all the packages that come with it. It also initializes the database under /var/lib/pgsql/9.3 and it will also setup the database to start automatically upon startup.

curl -O http://yum.postgresql.org/9.3/redhat/rhel-6-x86_64/pgdg-centos93-9.3-1.noarch
rpm -ivh pgdg-centos93-9.3-1.noarch.rpm
yum install postgresql93-*
service postgresql-9.3 initdb
chkconfig postgresql-9.3 on</pre>
vi /etc/sysconfig/pgsql/postgresql-9.3

On the file you ust created you will need to specify the location of where the database will be initialized. In my case (which is a bit unorthodox) will be:



Bonus: Install pgcrypto and enable it for a specific database.
Login to postgres

"psql -U postgres postgres"

Then connect to the database you wish to enable pgcrypto

\c name_of_database

Then enable the pgcrypto module.

\i /usr/share/pgsql/contrib/pgcrypto.sql
Share Button

Leave a Reply

Your email address will not be published.

Time limit is exhausted. Please reload the CAPTCHA.