Iam use centos 5.2 on my PC
Download the package from the PostgreSQL tarbal http://developer.postgres.org.
Open the package tarbal it.
# tar -zxvf postgresql-8.0.0rc4.tar.gz
# useradd -d /usr/local/pgsql postgres
# cd postgresql-8.0.0rc4
# ./configure --with-perl --with-python --with-ctl --with-openssl --with-pam
# gmake
# gmake check
# gmake install
# mkdir /usr/local/pgsql/data
# chown postgres.postgres /usr/local/pgsql/data
Edit the file /etc/ d.so.conf and add the following line.
/usr/local/pgsql/lib
Apply ldconfig configuration.
# ldconfig
Edit the file /etc/profile, and add the following line.
PATH = $ PATH: /usr/local/pgsql/bin
# su - postgres
$ /usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data
$ exit
# cp contrib/start-scripts/linux /etc/rc.d/init.d/postgresql
# chkconfig ?add postgresql
# chkconfig postgresql on
# service postgresql start
# ps -ax | grep postgres
16229 ? S 0:00 postgres: writer process
16230 ? S 0:00 postgres: stats buffer process
16231 ? S 0:00 postgres: stats collector process
Give login password postgres.
# su - postgres
$ psql -d template1
Welcome to psql 8.0.0rc4, the PostgreSQL interactive terminal.
Type: \copyright for distribution terms
\h for help with SQL commands
\? for help with psql commands
\g or terminate with semicolon to execute query
\q to quit
template1=# ALTER USER postgres WITH password 'passwordnya';
ALTER USER
template1=#\q
$ exit
Edit the file /usr/local/pgsql/data/pg_hba.conf, so it becomes serperti below.
local all all password
# IPv4 local connections:
host all all 127.0.0.1/32 password
# IPv6 local connections:
host all all ::1/128 password
# psql -U postgres -d template1
password:<isikan password>
Welcome to psql 8.0.0rc4, the PostgreSQL interactive terminal.
Type: \copyright for distribution terms
\h for help with SQL commands
\? for help with psql commands
\g or terminate with semicolon to execute query
\q to quit
template1=#\q
Up to here means the PostgresSQL database server is working properly
