Skip to content

Instantly share code, notes, and snippets.

@tejovanthn
Last active May 13, 2016 08:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tejovanthn/4fe5c7b29bb22e9806737635fa080a0f to your computer and use it in GitHub Desktop.
Save tejovanthn/4fe5c7b29bb22e9806737635fa080a0f to your computer and use it in GitHub Desktop.
upgrade postgres and reinit
psql username
CREATE EXTENSION cube;
CREATE EXTENSION earthdistance;
drop schema public cascade;
create schema public;
CREATE TABLE alembic_version (version_num VARCHAR(32) NOT NULL);
# http://www.postgresql.org/download/linux/ubuntu/
# Create the file /etc/apt/sources.list.d/pgdg.list, and add a line for the repository
deb http://apt.postgresql.org/pub/repos/apt/ trusty-pgdg main
# Import the repository signing key, and update the package lists
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
sudo apt-get update
# List all postgres, get rid of everything but the latest
dpkg -l | grep postgresql
# Install the latest postgresql
sudo apt-get install postgresql
# Create ROLE
sudo su - postgres
createuser --interactive
createdb username
psql
ALTER ROLE username PASSWORD 'password';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment