heroku pg:psql is the canonical (and faster!) way to connect to heroku db.

The reason heroku run rails db doesn't work is because what it does is it creates a one-off process on Heroku with your codebase and runs rails db command there. rails db depends on $RAILS_ENV environment variable to fetch db credentials from config/database.yml which doesn't work on Heroku.

If you must know your Heroku db password you can get it from heroku config:get DATABASE_URL