I'm not able to connect to my AWS Redshift database using RPostgreSQL.
Does anyone have an example of code that would work?
library (RPostgreSQL)
drv <- dbDriver("PostgreSQL")
conn <- dbConnect(drv, "database.us-east-1.redshift.amazonaws.com", "jeffz", "PsWrd123")
Error in postgresqlNewConnection(drv, ...) :
RS-DBI driver: (could not connect database.us-east-1.redshift.amazonaws.com@PsWrd123 on dbname "database.us-east-1.redshift.amazonaws.com"
Windows 7 postgresql-8.4-703.jdbc4 in drivers path to jre7 is set in environment
I had the same issue - here is an example of code that 'works' for me:
Using library (RPostgreSQL)
Using library(RODBC)
Full code here:
https://dreamtolearn.com/ryan/data_analytics_viz/93
https://github.com/rustyoldrake/AWS_Redshift_S3_R_Interface
* As the other person noted - if system is UNABLE TO CONNECT - ensure AWS has the security/access permissions opened up to allow Port 5439 access from YOUR IP (or all IPs) - by default they are NOT open, so if you don't open them, you will not connect
Make sure you allow access in RDS security groups by specifying 0.0.0.0/0 for all IPs