I cooked up this Heroku/subshell command today, and I like it:
$ psql $(heroku config:get DATABASE_URL)
This will connect me to the primary PostgreSQL database for my Heroku application in the psql client. Now I’m ready to query!
NOTE: why not
$ heroku pg:psql? I’m not sure. I think Heroku was reporting status issues today, and I wanted to bypass any infrastructure I could.