Connect to Heroku postgresql
PostgreSQL
Heroku
If you have psql installed locally, you can connect like this:
psql $(heroku config --app name_of_my_heroku_app | grep DATABASE_URL | awk '{print $2}')
If not, you can use a Heroku console:
heroku run rails dbconsole -a name_of_my_heroku_app# ENTER PASSWORD Password for user xxxxxxxxx: