Created
April 24, 2020 14:33
-
-
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
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
# 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