I recently started using DBeaver to connect to postgres databases, both local and remote.
Most of my production databases are currently on Heroku. The process of linking DBeaver to a Heroku Postgres database was fairly straightforward, with the exception of an SSL setting that is not very intuitive. I wanted to document these steps here for others trying to achieve the same thing.
Find your Heroku Database Credentials
The exact steps are slightly different based on whether you are using a hobby or pro Postgres Addon, but the idea is the same.
- Go to your Heroku App
- Click on the Heroku Postgres Addon
- Go To Settings + Credentials
Create New Connection in DBeaver
- Open the New Connection Wizard
- Select PostgresSQL as your Connection Type and click Next
- Fill out the Host, Database, Port, User, and Password fields to match the Heroku Credentials
Note: At this point, if you click Test Connection, you will see the connection fails with this message: “FATAL: no pg_hba.conf entry for host “X”, user “Y”, database “Z”, SSL off” – we will need to go through one more step to setup SSL.
- Click Next on the Connection Wizard Prompt
- Go to the SSL Tab
- Check Enable SSL
- Set the SSL Factory to org.postgresql.ssl.NonValidatingFactory
- Test Connection again – it should now return “Success”
- Click Finish, and your DBeaver Connection to your Heroku Postgres Database should be all set