It looks like this is a RubyMine issue. RubyMine will convert the hostname to an IP address and pg_hba.conf includes the hostname but not the IP address hence the error. It works fine from the command line (e.g. rails s).
java.sql.SQLException: FATAL: no pg_hba.conf entry for host
-
30-06-2022 - |
Question
Developing RoR app on Windows using RubyMine, trying to connect to Postgres database hosted on Heroku server. No Postgres installed locally. Getting "java.sql.SQLException: FATAL: no pg_hba.conf entry for host..." What to do, what to do?
Solution 2
OTHER TIPS
This is due to Heroku databases needing additional SSL configuration. You need to enable SSL in your jdbc string by appending:
?ssl=true&sslfactory=org.postgresql.ssl.NonValidatingFactory
For details see Heroku's help document.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow