Skip to content

Instantly share code, notes, and snippets.

@adamjstevenson
Created June 24, 2020 23:07
Show Gist options
  • Save adamjstevenson/96053147a1b7ea4c02d6b4468208b08e to your computer and use it in GitHub Desktop.
Save adamjstevenson/96053147a1b7ea4c02d6b4468208b08e to your computer and use it in GitHub Desktop.
Basic Postgres localhost database import cheatsheet
# 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