Connect to Postgres via SSL using R

https://github.com/r-dbi/RPostgres seems to be the more modern and maintained package at this point. This is what worked for me…

install.packages("RPostgres")
require(RPostgres)

db = dbConnect(
  Postgres(), 
  user="user",
  password = 'password',
  dbname="dbname",
  host="host",
  port = port,
  sslmode="require"
)

dbListTables(db)

Leave a Comment