Last active
April 18, 2022 15:39
-
-
Save garystafford/d4f66348a55d5a0da5ca7c7651176b95 to your computer and use it in GitHub Desktop.
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
# set postgres environment variables | |
# ** CHANGE ME ** | |
export PGHOST="postgres1.abcxyzdef.us-east-1.rds.amazonaws.com" | |
export PGPORT=5432 | |
export PGDATABASE="postgres" | |
export PGUSER="admin" | |
export PGPASSWORD="change_me!" | |
# create new v1 of pagila database | |
export PGDATABASE="postgres" | |
psql -c "CREATE DATABASE pagila_v1;" | |
# restore original version of pagila database | |
pg_restore -d pagila_v1 pagila.dump | |
# confirm pagila tables in public schema | |
export PGDATABASE="pagila_v1" | |
psql -c "\dt" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment