Skip to content

Instantly share code, notes, and snippets.

@rastasheep
Last active July 11, 2017 20:10
Show Gist options
  • Save rastasheep/4b7bf6ce1344dc0c00a0 to your computer and use it in GitHub Desktop.
Save rastasheep/4b7bf6ce1344dc0c00a0 to your computer and use it in GitHub Desktop.
Install PostgreSQL 9.4 on Semaphore
sudo apt-get remove -y postgresql-client-9.3 postgresql-9.3 postgresql-contrib-9.3 postgresql-server-dev-9.3
wget --quiet -O - http://apt.postgresql.org/pub/repos/apt/ACCC4CF8.asc | sudo apt-key add -
echo " deb http://apt.postgresql.org/pub/repos/apt/ precise-pgdg main" | sudo tee -a /etc/apt/sources.list
sudo apt-get update
sudo apt-get -y --force-yes install postgresql-9.4 postgresql-contrib-9.4
sudo su - postgres -c "pg_dropcluster --stop 9.4 main"
sudo su - postgres -c "pg_createcluster --start -e UTF-8 9.4 main"
sudo su - postgres -c "psql -c \"CREATE USER runner WITH PASSWORD 'semaphoredb';\" -d template1"
sudo su - postgres -c "psql -c \"ALTER USER runner CREATEUSER CREATEDB;\" -d template1"
sudo service postgresql start || true
@rastasheep
Copy link
Author

Upgrade postgresql on Semaphore to 9.4 with command like:
cd ~ && wget https://gist.githubusercontent.com/rastasheep/4b7bf6ce1344dc0c00a0/raw/pg_9.4.sh && bash pg_9.4.sh && cd -

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment