Installing PostgreSQL tar.gz

by Administrator 14. May 2009 03:36

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

Tags: ,

Add comment

  Country flag

biuquote
  • Comment
  • Preview
Loading

 

My Quote :P

Each morning when I open my eyes I say to myself: I, not events, have the power to make me happy or unhappy today. I can choose which it shall be. Yesterday is dead, tomorrow hasn’t arrived yet. I have just one day, today, and I’m going to be happy in it.

Month List

Page List