I use the RPostgreSQL 0.4 library (compiled according to R 2.15.3) on R 2.15.2 under the 64-bit version of Windows 7 to interact with PostgreSQL. This works great when connecting to my PostgreSQL databases on localhost. I am trying to run my R code with a remote PostgreSQL database on Heroku. I can connect to the Heroku PostgreSQL database from the psql command shell on my machine and it connects without problems. I get a message:
psql (9.2.3, server 9.1.9) WARNING: psql version 9.2, server version 9.1. Some psql features might not work. WARNING: Console code page (437) differs from Windows code page (1252) 8-bit characters might not work correctly. See psql reference page "Notes for Windows users" for details. SSL connection (cipher: DHE-RSA-AES256-SHA, bits: 256)
Obviously psql uses SSL to connect. However, when I try to connect using the RPostgreSQL dbConnect () library routine, supplying exactly the same credentials using dname =, host =, port =, user =, password =, the connection fails with a complaint:
Error in postgresqlNewConnection(drv, ...) : RS-DBI driver: (could not connect <user>@<hostname> on dbname <dbname>) Calls: source ... .valueClassTest -> is -> is -> postgresqlNewConnection -> .Call Execution halted
I know that Heroku insists on SSL connection if you want to remotely access your database, so it seems likely that the R dcConnect () interface routine is not trying to use SSL. Is there anything else I can do to get a remote connection from R to PostgreSQL on Heroku to work?
source share