Created
June 24, 2020 23:07
-
-
Save adamjstevenson/96053147a1b7ea4c02d6b4468208b08e to your computer and use it in GitHub Desktop.
Basic Postgres localhost database import cheatsheet
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
# Connect to local PG instance | |
psql -U postgres | |
# Show databases | |
\l | |
# Drop existing database and recreate | |
drop database DBNAME | |
create database DBNAME | |
# Import your gzipped SQL file | |
gunzip < ~/Downloads/IMPORT.sql.gz | psql DBNAME |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment