Connecting to heroku postgres with DataGrip (and other jetbrains apps)

Posted: 2016-02-08

DataGrip (and the other jetbrains apps) were refusing to connect to heroku postgresql databases even though the connection was correct.

Turns out that you must have SSL enabled but can't validate the certificate.

Add the following properties to the datasource advanced settings:

Name Value
ssltrue
sslfactoryorg.postgresql.ssl.NonValidatingFactory

Or to the url

?ssl=true&sslfactory=org.postgresql.ssl.NonValidatingFactory