Created
June 18, 2014 16:26
-
-
Save bradrydzewski/f10e71394a694fca307f to your computer and use it in GitHub Desktop.
Install Postgres 9.3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# remove existing 9.1 installation | |
sudo /etc/init.d/postgresql stop | |
sudo apt-get --force-yes -fuy remove --purge postgresql postgresql-9.1 postgresql-client | |
# install 9.3 | |
sudo apt-get install python-software-properties | |
sudo add-apt-repository 'deb http://apt.postgresql.org/pub/repos/apt/ precise-pgdg main' | |
sudo apt-get update | |
sudo apt-get install -y postgresql-9.3 | |
# update the postgres config files | |
sudo /bin/bash -c "cat <<EOF > /etc/postgresql/9.3/main/pg_hba.conf | |
local all postgres trust | |
local all all trust | |
host all all 127.0.0.1/32 trust | |
host all all ::1/128 trust | |
EOF" | |
# restart | |
sudo /etc/init.d/postgresql restart |
Thank you sir! It works like a charm =)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this command to your build script to install Postgres 9.3