Last active
May 13, 2016 08:50
-
-
Save tejovanthn/4fe5c7b29bb22e9806737635fa080a0f to your computer and use it in GitHub Desktop.
upgrade postgres and reinit
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
psql username | |
CREATE EXTENSION cube; | |
CREATE EXTENSION earthdistance; |
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
drop schema public cascade; | |
create schema public; | |
CREATE TABLE alembic_version (version_num VARCHAR(32) NOT NULL); |
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
# 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