Skip to content

Instantly share code, notes, and snippets.

@sarahg
Created April 24, 2020 14:33
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 sarahg/3ed7794dafa958279ccd7682d523a303 to your computer and use it in GitHub Desktop.
Save sarahg/3ed7794dafa958279ccd7682d523a303 to your computer and use it in GitHub Desktop.
Install postgres using Homebrew and load the "dvdrental" demo database on Mac OSX
# Install postgres with Homebrew:
brew update
brew install postgres
brew services start postgresql
/usr/local/opt/postgres/bin/createuser -s postgres
# Import the demo database and import it
# Download database: https://www.postgresqltutorial.com/postgresql-sample-database/
unzip ~/Downloads/dvdrental.zip
createdb dvdrental
pg_restore -d dvdrental -U postgres ~/Desktop/dvdrental.tar
# Verify this worked
psql
\l
\c dvdrental
\dt
SELECT * FROM actor LIMIT 10;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment