Wi-Fizzle.com - Putting the fizzle in Wi-Fi since 2005 .. (yes, this was a poor choice for a domain name)

<div class="news_item">#452<div class="news_title">(solved) Error connecting to Heroku Postgres database from Play Framework 2.0 connection error

Posted by dandriff on Tuesday August 21, 2012@03:29PM

 play -Dconfig.file=conf/prod.conf run
 ..
 heroku PSQLException: FATAL: no pg_hba.conf entry for host
 ..

The fix for this is to connect to postgresql using SSL, which in play framework 2.0.x can be achieved by appending everything after the "?" to your jdbc url, e.g.:
 db=postgres://user:password@server.example.net:5432/dbname?ssl=true&sslfactory=org.postgresql.ssl.NonValidatingFactory

Sources:
Keywords:
  • Heroku
  • Postgres
  • Postgresql
  • Play-Framework 2.0
  • SSL
  • Connection error