DBI
DBI copied to clipboard
dbConnect fails with no error message
I am trying to use DBI to connect to a postgres database. When I use dbConnect() it fails with no error message and outputs some symbols. Not sure what is causing this. Any help will be much appreciated
drv <- dbDriver("PostgreSQL")
dbConnect(drv, host=Sys.getenv('DB_HOST'),
port=Sys.getenv('DB_PORT'),
dbname=Sys.getenv('DB_NAME'),
user=Sys.getenv('DB_USER'),
password=Sys.getenv('DB_PASSWORD'))
I get that output regardless of the values of host, port, dbname, user and password I use. In fact If I run only this
drv <- dbDriver("PostgreSQL")
dbConnect(drv)
I get the same output.
Thanks. Can you try reinstalling the RPostgreSQL package, or try with the RPostgres package?
Thanks for the quick responce. I just tried that. I get the same output for both RPostgreSQL and RPostgres
What does the dbConnect()
call look like that you use to connect via RPostgres?