Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
upgrade postgres and reinit
psql username
CREATE EXTENSION earthdistance;
drop schema public cascade;
create schema public;
CREATE TABLE alembic_version (version_num VARCHAR(32) NOT NULL);
# Create the file /etc/apt/sources.list.d/pgdg.list, and add a line for the repository
deb trusty-pgdg main
# Import the repository signing key, and update the package lists
wget --quiet -O - | 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
ALTER ROLE username PASSWORD 'password';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.