1

I can not connect PostgreSQL(on Heroku) with RPostgreSQL on Windows(64bit).

I can connect local postgresql(not ssl) with RPostgreSQL on Windows. I can connect PostgreSQL on Heroku from PgAdmin on Windows. I can connect PostgreSQL on Heroku with RPostgreSQL on OSX and Linux.

Only RPostgreSQL on Windows can not connect Heroku PostgreSQL.

Error message is:

Error in postgresqlNewConnection(drv, ...) : 
  RD-DBI driver: (could not connect....xxxxx

Is there any solution?

Jaehyun Shin
  • 1,562
  • 14
  • 25

1 Answers1

7

It's related to this issue: Can't create dbConnect to Postgres with SSL. One solution that worked for me (also with a Heroku DB) is to use the RPostgres package instead. You can install the dev. version from Github: https://github.com/rstats-db/RPostgres.

Community
  • 1
  • 1
  • Is RPostgres more maintainable than RPostgreSQL? – Jaehyun Shin Aug 15 '16 at 06:10
  • What do you mean? The only disadvantage is that you can't get it from CRAN yet, but it is under active development by RStudio people (led by Hadley Wickham) so it should have more features in the medium term. – Philippe Marchand Aug 15 '16 at 18:55
  • I don't have any answer as to "why", but can also confirm that `Rpostgres`solved this problem for me too. I wasn't working with a Heroku DB, but rather using an Aptible DB (similar to Heroku, but HIPAA compliant). Interestingly, the `dbConnect` package does not require one to specify SSL, it "just works". I have edited Philippe's answer to include a working code chunk for any passers by. – joemienko Nov 04 '16 at 13:48
  • After wasting a lot of time with Rpostgresql try to connect to a Heroku data base, I tried installing Rpostgres and the problem was resolved. When installing this library you might be asked to install R tools to the system path. If that is a problem find help here: https://www.biostat.wisc.edu/~kbroman/Rintro/Rwinpack.html and here: https://github.com/stan-dev/rstan/wiki/Install-Rtools-for-Windows – SprengMeister Nov 30 '17 at 18:07