installing postgresql on RHEL4 update 3 from source

December 17, 2007 by gregorgede · Leave a Comment
Filed under: PHP 

1. make sure rpm’s version is not installed

$ rpm -qa | grep postgresql

if installed, remove it

$ rpm -e postgresql-pl postgresql-test postgresql-server

2. download the source

$ wget -b http://ftp9.id.postgresql.org/v8.2.5/postgresql-8.2.5.tar.bz2

3. after download has finished

$ ./configure
$ gmake
$ su
$ gmake install
$ adduser postgres
$ mkdir /usr/local/pgsql/data
$ chown postgres /usr/local/pgsql/data
$ su - postgres
$ /usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data
$ /usr/local/pgsql/bin/postgres -D /usr/local/pgsql/data >logfile 2>&1 &
$ /usr/local/pgsql/bin/createdb test
$ /usr/local/pgsql/bin/psql test

4. copy start-up script from contrib folder

$ pwd

make sure you are in postgresql-8.2.5 folder then

$ cd contrib/start-scripts/

$ cp linux /etc/rc.d/init.d/postgresql

$ chmod 755 /etc/rc.d/init.d/postgresql

$ chkconfig –add postgresql

$ service postgresql restart



Speak Your Mind

Tell us what you're thinking...
and oh, if you want a pic to show with your comment, go get a gravatar!