Skip to content

Instantly share code, notes, and snippets.

@sao
Last active December 21, 2015 07:58
Show Gist options
  • Save sao/6274751 to your computer and use it in GitHub Desktop.
Save sao/6274751 to your computer and use it in GitHub Desktop.
Add user and database to postgres from terminal
createuser --no-createdb --no-createrole --no-superuser [username]
createdb --owner [username] --encoding utf8 [database]
pg_restore --verbose --clean --no-acl --no-owner -h localhost -U [username] -d [database] -p 5432 [data_file]
PGUSER=[username] heroku pg:pull HEROKU_POSTGRESQL_NAME [local_database] --app app-name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment