• Install the base postgres stack
    wget http://ftp7.us.postgresql.org/pub/postgresql/v8.3.1/postgresql-8.3.1.tar.bz2
    tar -xjvf postgresql-8.3.1.tar.bz2
    cd postgresql-8.3.1
    #NOTE the LDFLAGS here... this is to support GEOS for postGIS
    LDFLAGS=-lstdc++ ./configure --with-perl --prefix=/usr/local/postgresql-8.3.1
    make
    make install
    cd doc
    make install
    
  • add the pg paths to your profile file to make accessing pg easy:
    PATH=$PATH:/usr/local/postgresql-8.3.1/bin
    MANPATH=$MANPATH:/usr/local/postgresql-8.3.1/man
    export PATH
    export MANPATH
    
  • add the postgres user (as root)
    sudo useradd postgres
    passwd xxxxxxx
    
  • Make a database and launch Postgres
    sudo mkdir /usr/local/postgresql-8.3.1/data
    sudo chown postgres /usr/local/postgresql-8.3.1/data
    
    #LOG IN AS POSTGRES!!!
    sudo su postgres
    cd /usr/local/postgresql-8.3.1/
    /usr/local/postgresql-8.3.1/bin/initdb ./data
    /usr/local/postgresql-8.3.1/bin/postmaster -D ./data/ > ./data/logfile.txt 2>&1 &
    
    
    #LOG OUT AS POSTGRES
    exit
    
    #Test it out
    psql -l -U postgres
    
    #optionally create new pg superuser
    createuser jlivni
    #Shall the new role be a superuser? (y/n) y
    #CREATE ROLE