Skip to content

Instantly share code, notes, and snippets.

@joaodubas
Last active December 20, 2015 23:48
Show Gist options
  • Save joaodubas/6214862 to your computer and use it in GitHub Desktop.
Save joaodubas/6214862 to your computer and use it in GitHub Desktop.
install postgres from source in #!
# assumindo que o usuario ja tem o codigo fonte do postgres
export SRCDIR=$HOME/local/src
# estes cabecalhos estao definidos por conta do configure
apt-get install libreadline-dev
apt-get install libxml2-dev
apt-get install libxslt1-dev
apt-get install libperl-dev
# configure make
./configure --prefix=$SRCDIR/pgsql --with-perl --with-python --with-libxml --with-libxslt
make
make install
# see http://www.postgresql.org/docs/current/static/install-short.html
adduser postgres
mkdir /usr/local/pgsql/data
chown postgres /usr/local/pgsql/data
su - postgres
/usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data
/usr/local/pgsql/bin/postgres -D /usr/local/pgsql/data >logfile 2>&1 &
/usr/local/pgsql/bin/createdb test
/usr/local/pgsql/bin/psql test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment