4

I want to connect to a database on Redshift and load a table to a data frame

I have the following:

  • Hostname (not JDBC URL)
  • Username
  • Password
  • Table name
  • Schema

What packages should I use?

I am looking for the right code if someone can help. Should I use RODBC or any other package?

epo3
  • 2,991
  • 2
  • 33
  • 60

2 Answers2

2
brew install libpq

install.packages('RPostgres')
library(RPostgres)
pconn_r <- dbConnect(RPostgres::Postgres(),
               host = host,
               port = port,
               user = user,
               password = password,
               dbname = dbname,
               sslmode='require')
Tomer Ben David
  • 8,286
  • 1
  • 43
  • 24
1

Use RJDBC package.

More details can be found on the official Amazon's site.

See also this post.

epo3
  • 2,991
  • 2
  • 33
  • 60