Skip to content

Instantly share code, notes, and snippets.

@marcioferreira
Created November 7, 2013 01:56
Show Gist options
  • Save marcioferreira/7347653 to your computer and use it in GitHub Desktop.
Save marcioferreira/7347653 to your computer and use it in GitHub Desktop.
wget http://ftp.postgresql.org/pub/source/v9.3.1/postgresql-9.3.1.tar.gz
tar -xf postgresql-9.3.1.tar.gz
sudo apt-get install libreadline-dev
sudo apt-get install zlib1g-dev
cd postgresql-9.3.1/
./configure
sudo su
make install
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
\q
exit
sudo apt-get install postgresql-9.1-postgis
sudo su - postgres
psql
CREATE DATABASE template_postgis
\list
psql -d template_postgis -f /usr/share/postgresql/9.1/contrib/postgis-1.5/postgis.sql
psql -d template_postgis -f /usr/share/postgresql/9.1/contrib/postgis-1.5/spatial_ref_sys.sql
psql -d template_postgis -f /usr/share/postgresql/9.1/contrib/postgis_comments.sql
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment