rpostgresqldbirpostgresqlrpostgres

Error in connecting to PostgreSQL in R using DBI connector


i am facing the following challenge, when i am trying to connect to the Rpostgresql using the DBI package i am getting the following error. Below is the code used for my connections

install.packages("DBI",INSTALL_opts="--no-multiarch")


suppressPackageStartupMessages(library('RPostgreSQL'))
suppressPackageStartupMessages(library('dplyr'))
suppressPackageStartupMessages(library("nortest"))
suppressPackageStartupMessages(library("DBI"))




con <- DBI::dbConnect(RPostgres::Postgres(),
                             dbname = "dbname",
                             host = "host",
                             port = "port",
                             password = "password",
                             user = "user",
                             base::list(sslmode="require", connect_timeout="10"),
                             service = NULL)

following the error i am getting which i am not able to resolve inspite of referring multiple posts on SO

Error in inDL(x, as.logical(local), as.logical(now), ...) : 
  unable to load shared object 'C:/Users/xxxx/Documents/R/win-library/4.0/Rcpp/libs/x64/Rcpp.dll':
  LoadLibrary failure:  The specified procedure could not be found.

Solution

  • After a lot of searching on the internet, I finally uninstalled and reinstalled the R. My earlier version was 3.6.3 and now it's 4.0.3 Now all the packages are working fine, no error at all... I guess it was an issue with the R version