Tuesday, July 11, 2006

PostgreSQL Installation

as user "cubs"

From PostgreSQL source code, after tar -zxvf the tar.gz file.

./configure --prefix $HOME/pgsql/system --with-pgport=6932 --with-java

To have a none system PostgreSQL installation and change the port to 6932.

make
make install

cd $HOME/pgsql/system/bin
./initdb -D $HOME/pgsql/data

cd $HOME
mkdir bin
create a file "startcubs.sh" contains

#!/bin/sh

# to start up postgresql for cubs

$HOME/pgsql/system/bin/postmaster -i -D $HOME/pgsql/data > $HOME/pgsql/logs/pgsql.log 2> $HOME/pgsql /logs/pgsql-errors.log &

create a file "stopcubs.sh" contains

#!/bin/sh
# to shutdown postgresql for cubs
kill -INT `head -1 $HOME/pgsql/data/postmaster.pid`

create a database named "cubs" with encoding UTF-8

createdb -d cubs --encoding="UNICODE"

No comments: