Btibert3
11/20/2013 - 4:21 PM

Redshift

Redshift

library("RPostgreSQL")

#Connect to Redshift
redshift.Connection <- dbConnect(dbDriver("PostgreSQL"), host="XXXXXXXXXXXXXXX.redshift.amazonaws.com", dbname="XXXXXXXX",
                                 user="XXXXXXX", password= "XXXXXXXXXX", port=XXXXXXXX)

query_string <- 
"select *
from table
where something = 'True';"

results <- dbGetQuery(redshift.Connection, query_string)