9/05/2014

Building and installing PostgreSQL 9.3.5 from sources (no sudo needed)

cd ~/dev
wget http://ftp.postgresql.org/pub/source/v9.3.5/postgresql-9.3.5.tar.gz
tar xvzf postgresql-9.3.5.tar.gz
ln -s postgresql-9.3.5 postgresql
cd postgresql-9.3.5/
./configure --without-readline --prefix=$HOME/tools/postgresql
make
make install
~/tools/postgresql/bin/initdb -D ~/tools/postgresql/data
~/tools/postgresql/bin/pg_ctl -D ~/tools/postgresql/data -l ~/tools/postgresql/postgresql.log start
~/tools/postgresql/bin/createdb mydatabasename
To autostart the server, add this to a startup script:
~/tools/postgresql/bin/pg_ctl -D ~/tools/postgresql/data -l ~/tools/postgresql/postgresql.log start

1 comment:

  1. If at the past step, you are getting "createdb: could not connect to database template1: could not connect to server: No such file or directory", no problem: just execute the last line again. The server was not started yet, but some seconds later it should be fine.

    ReplyDelete