Monday, November 30, 2009

PostgreSQL

# cd /usr/local/src
# tar -zxvf postgresql-x.x.x.tar.gz
# cd postgresql-x.x.x
# ./configure
# make
# make install

PostgreSQL installed, let the initial settings:

# useradd postgres
# passwd postgres
# mkdir /usr/local/pgsql/data
# chown postgres /usr/local/pgsql/data
# su postgres



User and server folder created, we initialize the first time the server

#initdb -D /usr/local/pgsql/data

Now we set some more details. Inside the file /etc/profile, add the following lines wid vi:

.
..
...
....
PATH=$PATH:/usr/local/pgsql/bin
MANPATH=$MANPATH:/usr/local/pgsql/man
export PATH MANPATH


Save the file and close the editor,
and :

# cd /usr/local/src/postgresql-x.x.x/contrib/start-scripts/
# cp linux /etc/rc.d/rc.postgresql
# chmod a+x /etc/rc.d/rc.postgresql


Your PostgreSQL is ready! To start it, run:

# /etc/rc.d/rc.postgresql start